Skip to content

Commit

Permalink
Merge branch 'Oldiesmann-generalfixes' into release-3.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>

# Conflicts:
#	Sources/BBCodeParser.php
  • Loading branch information
Sesquipedalian committed Nov 25, 2023
2 parents ecdc394 + 16c890b commit 92439b6
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Sources/Actions/Memberlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']])) {
Expand Down
1 change: 1 addition & 0 deletions Sources/Actions/NotifyBoard.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use SMF\BackwardCompatibility;
use SMF\Board;
use SMF\Config;
use SMF\ErrorHandler;
use SMF\Lang;
use SMF\Utils;
Expand Down
2 changes: 2 additions & 0 deletions Sources/Actions/NotifyTopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Post2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Register2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
1 change: 1 addition & 0 deletions Sources/Actions/TopicRestore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Sources/Actions/TopicSplit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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....
Expand Down Expand Up @@ -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'];
}

Expand Down Expand Up @@ -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'];
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '<blockquote><cite><a href="{scripturl}?{link}">{txt_quote_from}: {author} {txt_search_on} {date}</a></cite>',
'after' => '</blockquote>',
Expand Down
2 changes: 1 addition & 1 deletion Sources/Db/DatabaseApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
1 change: 1 addition & 0 deletions Sources/Graphics/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace SMF\Graphics;

use SMF\BackwardCompatibility;
use SMF\Cache\CacheApi;
use SMF\Config;
use SMF\ErrorHandler;
use SMF\Url;
Expand Down
4 changes: 2 additions & 2 deletions Sources/Msg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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...
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageManager/PackageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = [];
Expand Down
1 change: 1 addition & 0 deletions Sources/Subscriptions/PayPal/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace SMF\Subscriptions\PayPal;

use SMF\Config;
use SMF\Db\DatabaseApi as Db;
use SMF\Lang;

/**
Expand Down
3 changes: 2 additions & 1 deletion Sources/WebFetch/APIs/FtpFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use SMF\Config;
use SMF\Lang;
use SMF\PackageManager\FtpConnection;
use SMF\Url;
use SMF\WebFetch\WebFetchApi;

Expand Down Expand Up @@ -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) : '';

Expand Down
1 change: 1 addition & 0 deletions Sources/tasks/RemoveTempAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace SMF\Tasks;

use SMF\Config;
use SMF\ErrorHandler;
use SMF\Lang;
use SMF\Theme;
use SMF\Utils;
Expand Down
2 changes: 1 addition & 1 deletion Sources/tasks/UpdateUnicode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Themes/default/Admin.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* @version 3.0 Alpha 1
*/

use SMF\Actions\Admin\Permissions;
use SMF\Config;
use SMF\Lang;
use SMF\Theme;
Expand Down Expand Up @@ -928,7 +929,7 @@ function ($v)
<textarea rows="', (!empty($config_var['size']) ? $config_var['size'] : (!empty($config_var['rows']) ? $config_var['rows'] : 4)), '" cols="', (!empty($config_var['cols']) ? $config_var['cols'] : 30), '" ', $javascript, $disabled, ' name="', $config_var['name'], '" id="', $config_var['name'], '">', $config_var['value'], '</textarea>';
// 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')
Expand Down

0 comments on commit 92439b6

Please sign in to comment.