diff --git a/Sources/Actions/Memberlist.php b/Sources/Actions/Memberlist.php index e15bd594a6..4df6e61490 100644 --- a/Sources/Actions/Memberlist.php +++ b/Sources/Actions/Memberlist.php @@ -508,7 +508,7 @@ public function search() $_POST['fields'] = ['name']; } - $_POST['fields'] = array_intersect($_POST['fields'], array_merge(['name', 'website', 'group', 'email'], array_keys($context['custom_search_fields']))); + $_POST['fields'] = array_intersect($_POST['fields'], array_merge(['name', 'website', 'group', 'email'], array_keys(Utils::$context['custom_search_fields']))); // Set defaults for how the results are sorted if (!isset($_REQUEST['sort']) || !isset(Utils::$context['columns'][$_REQUEST['sort']])) { diff --git a/Sources/Actions/NotifyBoard.php b/Sources/Actions/NotifyBoard.php index da7038854f..cb0a7c573f 100644 --- a/Sources/Actions/NotifyBoard.php +++ b/Sources/Actions/NotifyBoard.php @@ -15,6 +15,7 @@ use SMF\BackwardCompatibility; use SMF\Board; +use SMF\Config; use SMF\ErrorHandler; use SMF\Lang; use SMF\Utils; diff --git a/Sources/Actions/NotifyTopic.php b/Sources/Actions/NotifyTopic.php index 867e0f4dac..9bfb667407 100644 --- a/Sources/Actions/NotifyTopic.php +++ b/Sources/Actions/NotifyTopic.php @@ -14,10 +14,12 @@ namespace SMF\Actions; use SMF\BackwardCompatibility; +use SMF\Config; use SMF\Db\DatabaseApi as Db; use SMF\ErrorHandler; use SMF\Lang; use SMF\Topic; +use SMF\Utils; /** * Toggles email notification preferences for topics. diff --git a/Sources/Actions/Post2.php b/Sources/Actions/Post2.php index e6ea4b4047..9ea07257d0 100644 --- a/Sources/Actions/Post2.php +++ b/Sources/Actions/Post2.php @@ -542,7 +542,7 @@ public function submit(): void // If you're not allowed to edit any and all events, you have to be the poster. if (!User::$me->allowedTo('calendar_edit_any')) { - User::$me->isAllowedTo('calendar_edit_' . (!empty(User::$me->id) && self::getEventPoster($_REQUEST['eventid']) == User::$me->id ? 'own' : 'any')); + User::$me->isAllowedTo('calendar_edit_' . (!empty(User::$me->id) && Calendar::getEventPoster($_REQUEST['eventid']) == User::$me->id ? 'own' : 'any')); } // Delete it? diff --git a/Sources/Actions/Register2.php b/Sources/Actions/Register2.php index 4ab352468f..72a5cf6f20 100644 --- a/Sources/Actions/Register2.php +++ b/Sources/Actions/Register2.php @@ -417,7 +417,7 @@ function (&$value, $key) { // Don't update if the default is the same. if ($var != $pref) { - setNotifyPrefs($member_id, ['announcements' => (int) !empty($_POST['notify_announcements'])]); + Notify::setNotifyPrefs($member_id, ['announcements' => (int) !empty($_POST['notify_announcements'])]); } // We'll do custom fields after as then we get to use the helper function! diff --git a/Sources/Actions/TopicRestore.php b/Sources/Actions/TopicRestore.php index 12cefef4dc..c4941a394c 100644 --- a/Sources/Actions/TopicRestore.php +++ b/Sources/Actions/TopicRestore.php @@ -16,6 +16,7 @@ use SMF\BackwardCompatibility; use SMF\Config; use SMF\Db\DatabaseApi as Db; +use SMF\ErrorHandler; use SMF\Logging; use SMF\Msg; use SMF\Topic; diff --git a/Sources/Actions/TopicSplit.php b/Sources/Actions/TopicSplit.php index 4eaea427d6..1d44cf6c9c 100644 --- a/Sources/Actions/TopicSplit.php +++ b/Sources/Actions/TopicSplit.php @@ -201,7 +201,7 @@ public function index() // Check if this is the first message in the topic (if so, the first and second option won't be available) if ($id_first_msg == $_GET['at']) { - return select(); + return $this->select(); } // Basic template information.... @@ -271,7 +271,7 @@ public function split() } Utils::$context['old_topic'] = Topic::$topic_id; - Utils::$context['new_topic'] = splitTopic(Topic::$topic_id, $messagesToBeSplit, $_POST['subname']); + Utils::$context['new_topic'] = $this->splitTopic(Topic::$topic_id, $messagesToBeSplit, $_POST['subname']); Utils::$context['page_title'] = Lang::$txt['split']; } @@ -591,7 +591,7 @@ public function splitSelection() } Utils::$context['old_topic'] = Topic::$topic_id; - Utils::$context['new_topic'] = splitTopic(Topic::$topic_id, $_SESSION['split_selection'][Topic::$topic_id], $_POST['subname']); + Utils::$context['new_topic'] = $this->splitTopic(Topic::$topic_id, $_SESSION['split_selection'][Topic::$topic_id], $_POST['subname']); Utils::$context['page_title'] = Lang::$txt['split']; } diff --git a/Sources/BBCodeParser.php b/Sources/BBCodeParser.php index 1773c439c0..d59187f53f 100644 --- a/Sources/BBCodeParser.php +++ b/Sources/BBCodeParser.php @@ -614,7 +614,7 @@ class BBCodeParser 'parameters' => [ 'author' => ['match' => '([^<>]{1,192}?)'], 'link' => ['match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|msg=\d+?|action=profile;u=\d+)'], - 'date' => ['match' => '(\d+)', 'validate' => 'timeformat'], + 'date' => ['match' => '(\d+)', 'validate' => 'SMF\\Time::timeformat'], ], 'before' => '
{txt_quote_from}: {author} {txt_search_on} {date}', 'after' => '
', diff --git a/Sources/Db/DatabaseApi.php b/Sources/Db/DatabaseApi.php index e124f14fea..53fc3504b4 100644 --- a/Sources/Db/DatabaseApi.php +++ b/Sources/Db/DatabaseApi.php @@ -363,7 +363,7 @@ final public static function load(array $options = []) // Double check that we found what we expected. if (!(self::$db instanceof DatabaseApi)) { - unset($self::$db); + unset(self::$db); ErrorHandler::displayDbError(); } diff --git a/Sources/Graphics/Image.php b/Sources/Graphics/Image.php index e20c52f931..e754eb658d 100644 --- a/Sources/Graphics/Image.php +++ b/Sources/Graphics/Image.php @@ -14,6 +14,7 @@ namespace SMF\Graphics; use SMF\BackwardCompatibility; +use SMF\Cache\CacheApi; use SMF\Config; use SMF\ErrorHandler; use SMF\Url; diff --git a/Sources/Msg.php b/Sources/Msg.php index f1236d6be6..3b2c328fd3 100644 --- a/Sources/Msg.php +++ b/Sources/Msg.php @@ -726,7 +726,7 @@ function ($a) { $non_breaking_space = Utils::$context['utf8'] ? '\x{A0}' : '\xA0'; // Now that we've fixed all the code tags, let's fix the img and url tags... - fixTags($message); + self::fixTags($message); // Replace /me.+?\n with [me=name]dsf[/me]\n. if (strpos(User::$me->name, '[') !== false || strpos(User::$me->name, ']') !== false || strpos(User::$me->name, '\'') !== false || strpos(User::$me->name, '"') !== false) { @@ -1033,7 +1033,7 @@ public static function fixTags(&$message): void // Fix each type of tag. foreach ($fixArray as $param) { - fixTag($message, $param['tag'], $param['protocols'], $param['embeddedUrl'], $param['hasEqualSign'], !empty($param['hasExtra'])); + self::fixTag($message, $param['tag'], $param['protocols'], $param['embeddedUrl'], $param['hasEqualSign'], !empty($param['hasExtra'])); } // Now fix possible security problems with images loading links automatically... diff --git a/Sources/PackageManager/PackageManager.php b/Sources/PackageManager/PackageManager.php index 2e6bbe3204..6f51bc13cd 100644 --- a/Sources/PackageManager/PackageManager.php +++ b/Sources/PackageManager/PackageManager.php @@ -2046,7 +2046,7 @@ public function permissions() // If we're submitting then let's move on to another function to keep things cleaner.. if (isset($_POST['action_changes'])) { - return PackagePermissionsAction(); + return $this->PackagePermissionsAction(); } Utils::$context['look_for'] = []; diff --git a/Sources/Subscriptions/PayPal/Payment.php b/Sources/Subscriptions/PayPal/Payment.php index 23fbc70285..bcc4d2c417 100644 --- a/Sources/Subscriptions/PayPal/Payment.php +++ b/Sources/Subscriptions/PayPal/Payment.php @@ -14,6 +14,7 @@ namespace SMF\Subscriptions\PayPal; use SMF\Config; +use SMF\Db\DatabaseApi as Db; use SMF\Lang; /** diff --git a/Sources/WebFetch/APIs/FtpFetcher.php b/Sources/WebFetch/APIs/FtpFetcher.php index e27e2417e5..8ad34687ca 100644 --- a/Sources/WebFetch/APIs/FtpFetcher.php +++ b/Sources/WebFetch/APIs/FtpFetcher.php @@ -15,6 +15,7 @@ use SMF\Config; use SMF\Lang; +use SMF\PackageManager\FtpConnection; use SMF\Url; use SMF\WebFetch\WebFetchApi; @@ -120,7 +121,7 @@ public function request(string $url, array|string $post_data = []): object $this->port = !empty($url->port) ? $url->port : 21; // Establish a connection and attempt to enable passive mode. - $ftp = new SMF\PackageManager\FtpConnection($this->host, $this->port, $this->user, $this->email); + $ftp = new FtpConnection($this->host, $this->port, $this->user, $this->email); $this->error_message = !empty($ftp->error) ? (string) ($ftp->last_message ?? $ftp->error) : ''; diff --git a/Sources/tasks/RemoveTempAttachments.php b/Sources/tasks/RemoveTempAttachments.php index 536443fa7c..20ea48d771 100644 --- a/Sources/tasks/RemoveTempAttachments.php +++ b/Sources/tasks/RemoveTempAttachments.php @@ -14,6 +14,7 @@ namespace SMF\Tasks; use SMF\Config; +use SMF\ErrorHandler; use SMF\Lang; use SMF\Theme; use SMF\Utils; diff --git a/Sources/tasks/UpdateUnicode.php b/Sources/tasks/UpdateUnicode.php index 44c62fbec8..7f34c72aec 100644 --- a/Sources/tasks/UpdateUnicode.php +++ b/Sources/tasks/UpdateUnicode.php @@ -14,7 +14,7 @@ namespace SMF\Tasks; use SMF\Config; -use SMF\DatabaseApi as Db; +use SMF\Db\DatabaseApi as Db; use SMF\ErrorHandler; use SMF\Lang; use SMF\TaskRunner; diff --git a/Themes/default/Admin.template.php b/Themes/default/Admin.template.php index 86e1c0691d..f65a612ad2 100644 --- a/Themes/default/Admin.template.php +++ b/Themes/default/Admin.template.php @@ -10,6 +10,7 @@ * @version 3.0 Alpha 1 */ +use SMF\Actions\Admin\Permissions; use SMF\Config; use SMF\Lang; use SMF\Theme; @@ -928,7 +929,7 @@ function ($v) '; // Permission group? elseif ($config_var['type'] == 'permissions') - theme_inline_permissions($config_var['name']); + Permissions::theme_inline_permissions($config_var['name']); // BBC selection? elseif ($config_var['type'] == 'bbc')