From c3ba2e0f94118fd4d5d231b76aeb031d97b6d26b Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Thu, 12 Sep 2019 23:18:50 +0100 Subject: [PATCH] [BugFix] Plugins ExtendedProfile and OverwriteThemeBackground - admin is identical to system path names. --- lib/profile/nickname.php | 4 ++-- plugins/ExtendedProfile/ExtendedProfilePlugin.php | 4 ++-- plugins/ExtendedProfile/actions/profilefieldsadminpanel.php | 4 ++-- .../OverwriteThemeBackgroundPlugin.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/profile/nickname.php b/lib/profile/nickname.php index cdceaef726..194c829164 100644 --- a/lib/profile/nickname.php +++ b/lib/profile/nickname.php @@ -192,10 +192,10 @@ class Nickname */ public static function isSystemPath($str) { - $paths = array(); + $paths = []; // All directory and file names in site root should be blacklisted - $d = dir(INSTALLDIR); + $d = dir(PUBLICDIR); while (false !== ($entry = $d->read())) { $paths[$entry] = true; } diff --git a/plugins/ExtendedProfile/ExtendedProfilePlugin.php b/plugins/ExtendedProfile/ExtendedProfilePlugin.php index 09cdce35ed..c3b7492d2c 100644 --- a/plugins/ExtendedProfile/ExtendedProfilePlugin.php +++ b/plugins/ExtendedProfile/ExtendedProfilePlugin.php @@ -33,7 +33,7 @@ include_once __DIR__ . '/lib/profiletools.php'; class ExtendedProfilePlugin extends Plugin { - const PLUGIN_VERSION = '3.0.0'; + const PLUGIN_VERSION = '3.0.1'; public function onPluginVersion(array &$versions): bool { @@ -75,7 +75,7 @@ class ExtendedProfilePlugin extends Plugin ['action' => 'profiledetailsettings'] ); $m->connect( - 'admin/profilefields', + 'panel/profilefields', ['action' => 'profilefieldsAdminPanel'] ); diff --git a/plugins/ExtendedProfile/actions/profilefieldsadminpanel.php b/plugins/ExtendedProfile/actions/profilefieldsadminpanel.php index d142fb1cda..5bb5d1cfdc 100644 --- a/plugins/ExtendedProfile/actions/profilefieldsadminpanel.php +++ b/plugins/ExtendedProfile/actions/profilefieldsadminpanel.php @@ -127,7 +127,7 @@ class ProfilefieldsAdminForm extends AdminForm public function action(): string { - return '/admin/profilefields'; + return common_local_url('profilefieldsAdminPanel'); } public function formData(): void @@ -158,7 +158,7 @@ class ProfilefieldsAdminForm extends AdminForm $this->out->elementStart('div'); $this->out->element( 'a', - array('href' => '/admin/profilefields?edit=' . $field->id), + ['href' => common_local_url('profilefieldsAdminPanel').'?edit=' . $field->id], $field->title ); $this->out->text(' (' . $field->type . '): ' . $field->description); diff --git a/plugins/OverwriteThemeBackground/OverwriteThemeBackgroundPlugin.php b/plugins/OverwriteThemeBackground/OverwriteThemeBackgroundPlugin.php index 125e69ba67..0daca528ca 100644 --- a/plugins/OverwriteThemeBackground/OverwriteThemeBackgroundPlugin.php +++ b/plugins/OverwriteThemeBackground/OverwriteThemeBackgroundPlugin.php @@ -33,7 +33,7 @@ defined('GNUSOCIAL') || die(); */ class OverwriteThemeBackgroundPlugin extends Plugin { - const PLUGIN_VERSION = '0.1.0'; + const PLUGIN_VERSION = '0.1.1'; /** * Route urls @@ -46,7 +46,7 @@ class OverwriteThemeBackgroundPlugin extends Plugin { $m->connect('plugins/OverwriteThemeBackground/css/my_custom_theme_bg', ['action' => 'OverwriteThemeBackgroundCSS']); - $m->connect('admin/overwritethemebackground', + $m->connect('panel/overwritethemebackground', ['action' => 'overwritethemebackgroundAdminPanel']); return true; }