Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release-2.1' into mysql_mb4
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulen committed Nov 5, 2023
2 parents 0250924 + 3ec6008 commit 3168adb
Show file tree
Hide file tree
Showing 96 changed files with 3,600 additions and 1,891 deletions.
26 changes: 13 additions & 13 deletions SSI.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boar
}
$smcFunc['db_free_result']($request);

// If mods want to do somthing with this list of topics, let them do that now.
// If mods want to do something with this list of topics, let them do that now.
call_integration_hook('integrate_ssi_recentTopics', array(&$posts));

// Just return it.
Expand Down Expand Up @@ -796,7 +796,7 @@ function ssi_topPoster($topNumber = 1, $output_method = 'echo')
);
$smcFunc['db_free_result']($request);

// If mods want to do somthing with this list of members, let them do that now.
// If mods want to do something with this list of members, let them do that now.
call_integration_hook('integrate_ssi_topPoster', array(&$return));

// Just return all the top posters.
Expand Down Expand Up @@ -851,7 +851,7 @@ function ssi_topBoards($num_top = 10, $output_method = 'echo')
);
$smcFunc['db_free_result']($request);

// If mods want to do somthing with this list of boards, let them do that now.
// If mods want to do something with this list of boards, let them do that now.
call_integration_hook('integrate_ssi_topBoards', array(&$boards));

// If we shouldn't output or have nothing to output, just jump out.
Expand Down Expand Up @@ -946,7 +946,7 @@ function ssi_topTopics($type = 'replies', $num_topics = 10, $output_method = 'ec
}
$smcFunc['db_free_result']($request);

// If mods want to do somthing with this list of topics, let them do that now.
// If mods want to do something with this list of topics, let them do that now.
call_integration_hook('integrate_ssi_topTopics', array(&$topics, $type));

if ($output_method != 'echo' || empty($topics))
Expand Down Expand Up @@ -1153,7 +1153,7 @@ function ssi_queryMembers($query_where = null, $query_where_params = array(), $q
if (empty($members))
return array();

// If mods want to do somthing with this list of members, let them do that now.
// If mods want to do something with this list of members, let them do that now.
call_integration_hook('integrate_ssi_queryMembers', array(&$members));

// Load the members.
Expand Down Expand Up @@ -1232,7 +1232,7 @@ function ssi_boardStats($output_method = 'echo')
list ($totals['categories']) = $smcFunc['db_fetch_row']($result);
$smcFunc['db_free_result']($result);

// If mods want to do somthing with the board stats, let them do that now.
// If mods want to do something with the board stats, let them do that now.
call_integration_hook('integrate_ssi_boardStats', array(&$totals));

if ($output_method != 'echo')
Expand Down Expand Up @@ -1262,7 +1262,7 @@ function ssi_whosOnline($output_method = 'echo')
);
$return = getMembersOnlineStats($membersOnlineOptions);

// If mods want to do somthing with the list of who is online, let them do that now.
// If mods want to do something with the list of who is online, let them do that now.
call_integration_hook('integrate_ssi_whosOnline', array(&$return));

// Add some redundancy for backwards compatibility reasons.
Expand Down Expand Up @@ -1496,7 +1496,7 @@ function ssi_recentPoll($topPollInstead = false, $output_method = 'echo')

$return['allowed_warning'] = $row['max_votes'] > 1 ? sprintf($txt['poll_options_limit'], min(count($sOptions), $row['max_votes'])) : '';

// If mods want to do somthing with this list of polls, let them do that now.
// If mods want to do something with this list of polls, let them do that now.
call_integration_hook('integrate_ssi_recentPoll', array(&$return, $topPollInstead));

if ($output_method != 'echo')
Expand Down Expand Up @@ -1665,7 +1665,7 @@ function ssi_showPoll($topic = null, $output_method = 'echo')

$return['allowed_warning'] = $row['max_votes'] > 1 ? sprintf($txt['poll_options_limit'], min(count($sOptions), $row['max_votes'])) : '';

// If mods want to do somthing with this poll, let them do that now.
// If mods want to do something with this poll, let them do that now.
call_integration_hook('integrate_ssi_showPoll', array(&$return));

if ($output_method != 'echo')
Expand Down Expand Up @@ -1867,7 +1867,7 @@ function ssi_news($output_method = 'echo')

$context['random_news_line'] = !empty($context['news_lines']) ? $context['news_lines'][mt_rand(0, count($context['news_lines']) - 1)] : '';

// If mods want to do somthing with the news, let them do that now. Don't need to pass the news line itself, since it is already in $context.
// If mods want to do something with the news, let them do that now. Don't need to pass the news line itself, since it is already in $context.
call_integration_hook('integrate_ssi_news');

if ($output_method != 'echo')
Expand Down Expand Up @@ -2208,7 +2208,7 @@ function ssi_boardNews($board = null, $limit = null, $start = null, $length = nu

$return[count($return) - 1]['is_last'] = true;

// If mods want to do somthing with this list of posts, let them do that now.
// If mods want to do something with this list of posts, let them do that now.
call_integration_hook('integrate_ssi_boardNews', array(&$return));

if ($output_method != 'echo')
Expand Down Expand Up @@ -2348,7 +2348,7 @@ function ssi_recentEvents($max_events = 7, $output_method = 'echo')
foreach ($return as $mday => $array)
$return[$mday][count($array) - 1]['is_last'] = true;

// If mods want to do somthing with this list of events, let them do that now.
// If mods want to do something with this list of events, let them do that now.
call_integration_hook('integrate_ssi_recentEvents', array(&$return));

if ($output_method != 'echo' || empty($return))
Expand Down Expand Up @@ -2497,7 +2497,7 @@ function ssi_recentAttachments($num_attachments = 10, $attachment_ext = array(),
}
$smcFunc['db_free_result']($request);

// If mods want to do somthing with this list of attachments, let them do that now.
// If mods want to do something with this list of attachments, let them do that now.
call_integration_hook('integrate_ssi_recentAttachments', array(&$attachments));

// So you just want an array? Here you can have it.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Cache/CacheApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function connect();
* @param int $ttl Overrides the default TTL. Not really used anymore,
* but is kept for backwards compatibility.
* @return mixed The result from the cache, if there is no data or it is invalid, we return null.
* @todo Seperate existence checking into its own method
* @todo Separate existence checking into its own method
*/
public function getData($key, $ttl = null);

Expand All @@ -58,7 +58,7 @@ public function getData($key, $ttl = null);
* @param int $ttl How long (in seconds) the data should be cached for.
* The default TTL will be used if this is null.
* @return bool Whether or not we could save this to the cache.
* @todo Seperate deletion into its own method
* @todo Separate deletion into its own method
*/
public function putData($key, $value, $ttl = null);

Expand Down
2 changes: 1 addition & 1 deletion Sources/Class-CurlFetchWeb.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private function set_options()
else
$this->options = $this->default_options;

// POST data options, here we don't allow any overide
// POST data options, here we don't allow any override
if (isset($this->post_data))
{
$this->options[CURLOPT_POST] = 1;
Expand Down
8 changes: 4 additions & 4 deletions Sources/Class-Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ protected function _parse($data)
}
}

// Wait for an actual occurance of an element.
// Wait for an actual occurrence of an element.
continue;
}

Expand Down Expand Up @@ -532,7 +532,7 @@ protected function _xml($array, $indent)
$inside_elements = false;
$output_el = '';

// Run through and recursively output all the elements or attrbutes inside this.
// Run through and recursively output all the elements or attributes inside this.
foreach ($array as $k => $v)
{
if (substr($k, 0, 1) == '@')
Expand Down Expand Up @@ -876,7 +876,7 @@ public function chdir($ftp_path)
}

/**
* Changes a files atrributes (chmod)
* Changes a files attributes (chmod)
*
* @param string $ftp_file The file to CHMOD
* @param int|string $chmod The value for the CHMOD operation
Expand Down Expand Up @@ -1057,7 +1057,7 @@ public function list_dir($ftp_path = '', $search = false)
if (!is_resource($this->connection))
return false;

// Passive... non-agressive...
// Passive... non-aggressive...
if (!$this->passive())
return false;

Expand Down
2 changes: 1 addition & 1 deletion Sources/Class-SearchAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function searchSort($a, $b);
* @param string $word A word to index
* @param array $wordsSearch Search words
* @param array $wordsExclude Words to exclude
* @param bool $isExcluded Whether the specfied word should be excluded
* @param bool $isExcluded Whether the specified word should be excluded
*/
public function prepareIndexes($word, array &$wordsSearch, array &$wordsExclude, $isExcluded);

Expand Down
8 changes: 4 additions & 4 deletions Sources/DbPackages-mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function db_packages_init()
* - 'ignore' will do nothing if the table exists. (And will return true)
* - 'overwrite' will drop any existing table of the same name.
* - 'error' will return false if the table already exists.
* - 'update' will update the table if the table already exists (no change of ai field and only colums with the same name keep the data)
* - 'update' will update the table if the table already exists (no change of ai field and only columns with the same name keep the data)
*
* @param string $table_name The name of the table to create
* @param array $columns An array of column info in the specified format
Expand Down Expand Up @@ -160,7 +160,7 @@ function smf_db_create_table($table_name, $columns, $indexes = array(), $paramet
// Loop through the indexes next...
foreach ($indexes as $index)
{
// MySQL If its a text column, we need to add a size.
// MySQL If it's a text column, we need to add a size.
foreach ($index['columns'] as &$c)
{
$c = trim($c);
Expand Down Expand Up @@ -465,7 +465,7 @@ function smf_db_change_column($table_name, $old_column, $column_info)
// Allow for unsigned integers (mysql only)
$unsigned = in_array($type, array('int', 'tinyint', 'smallint', 'mediumint', 'bigint')) && !empty($column_info['unsigned']) ? 'unsigned ' : '';

// If you need to drop the default, that needs it's own thing...
// If you need to drop the default, that needs its own thing...
// Must be done first, in case the default type is inconsistent with the other changes.
if ($column_info['drop_default'])
{
Expand Down Expand Up @@ -525,7 +525,7 @@ function smf_db_add_index($table_name, $index_info, $parameters = array(), $if_e
if (empty($index_info['columns']))
return false;

// MySQL If its a text column, we need to add a size.
// MySQL If it's a text column, we need to add a size.
$cols = $smcFunc['db_list_columns']($table_name, true);
foreach ($index_info['columns'] as &$c)
{
Expand Down
6 changes: 3 additions & 3 deletions Sources/DbPackages-postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function db_packages_init()
* - 'ignore' will do nothing if the table exists. (And will return true)
* - 'overwrite' will drop any existing table of the same name.
* - 'error' will return false if the table already exists.
* - 'update' will update the table if the table already exists (no change of ai field and only colums with the same name keep the data)
* - 'update' will update the table if the table already exists (no change of ai field and only columns with the same name keep the data)
*
* @param string $table_name The name of the table to create
* @param array $columns An array of column info in the specified format
Expand Down Expand Up @@ -314,7 +314,7 @@ function smf_db_drop_table($table_name, $parameters = array(), $error = 'fatal')
// the table
$table_query = 'DROP TABLE ' . $short_table_name;

// and the assosciated sequence, if any
// and the associated sequence, if any
$sequence_query = 'DROP SEQUENCE IF EXISTS ' . $short_table_name . '_seq';

// drop them
Expand Down Expand Up @@ -499,7 +499,7 @@ function smf_db_change_column($table_name, $old_column, $column_info)
if (($column_info['not_null'] === true) && !$column_info['drop_default'] && array_key_exists('default', $column_info) && is_null($column_info['default']))
unset($column_info['default']);

// If you need to drop the default, that needs it's own thing...
// If you need to drop the default, that needs its own thing...
// Must be done first, in case the default type is inconsistent with the other changes.
if ($column_info['drop_default'])
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ function Display()
$context['page_index'] = constructPageIndex($scripturl . '?topic=' . $topic . '.%1$d', $_REQUEST['start'], $context['total_visible_posts'], $context['messages_per_page'], true);
$context['start'] = $_REQUEST['start'];

// This is information about which page is current, and which page we're on - in case you don't like the constructed page index. (again, wireles..)
// This is information about which page is current, and which page we're on - in case you don't like the constructed page index. (again, wireless..)
$context['page_info'] = array(
'current_page' => $_REQUEST['start'] / $context['messages_per_page'] + 1,
'num_pages' => floor(($context['total_visible_posts'] - 1) / $context['messages_per_page']) + 1,
Expand Down
2 changes: 1 addition & 1 deletion Sources/Drafts.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ function showProfileDrafts($memID, $draft_type = 0)
}

// Find this user's drafts for the boards they can access
// @todo ... do we want to do this? If they were able to create a draft, do we remove thier access to said draft if they loose
// @todo ... do we want to do this? If they were able to create a draft, do we remove their access to said draft if they loose
// access to the board or if the topic moves to a board they can not see?
$request = $smcFunc['db_query']('', '
SELECT
Expand Down
15 changes: 13 additions & 2 deletions Sources/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ function fatal_lang_error($error, $log = 'general', $sprintf = array(), $status
loadTheme();
}

// Attempt to load the text string.
loadLanguage('Errors');
if (empty($txt[$error]))
$error_message = $error;
else
$error_message = empty($sprintf) ? $txt[$error] : vsprintf($txt[$error], $sprintf);

// Send a custom header if we have a custom message.
if (isset($_REQUEST['js']) || isset($_REQUEST['xml']) || isset($_RQEUEST['ajax']))
header('X-SMF-errormsg: ' . $error_message);

// If we have no theme stuff we can't have the language file...
if (empty($context['theme_loaded']))
die($error);
Expand All @@ -228,7 +239,7 @@ function fatal_lang_error($error, $log = 'general', $sprintf = array(), $status
}

// Load the language file, only if it needs to be reloaded
if ($reload_lang_file)
if ($reload_lang_file && !empty($txt[$error]))
{
loadLanguage('Errors');
$error_message = empty($sprintf) ? $txt[$error] : vsprintf($txt[$error], $sprintf);
Expand Down Expand Up @@ -300,7 +311,7 @@ function smf_error_handler($error_level, $error_string, $file, $line)

$message = log_error($error_level . ': ' . $error_string, $error_type, $file, $line);

// Let's give integrations a chance to ouput a bit differently
// Let's give integrations a chance to output a bit differently
call_integration_hook('integrate_output_error', array($message, $error_type, $error_level, $file, $line));

// Dying on these errors only causes MORE problems (blank pages!)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Groups.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file currently just shows group info, and allows certain priviledged members to add/remove members.
* This file currently just shows group info, and allows certain privileged members to add/remove members.
*
* Simple Machines Forum (SMF)
*
Expand Down
5 changes: 5 additions & 0 deletions Sources/Likes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class Likes
*/
protected $_js = false;

/**
* @var string The sub action sent in $_GET['sa'].
*/
protected $_sa = null;

/**
* @var string If filled, its value will contain a string matching a key on a language var $txt[$this->_error]
*/
Expand Down
2 changes: 1 addition & 1 deletion Sources/Load.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function reloadSettings()
$string = mb_decode_numericentity($string, array(0, 0x10FFFF, 0, 0xFFFFFF), 'UTF-8');
}

// Use optmized function for compatibility casefolding.
// Use optimized function for compatibility casefolding.
if ($form === 'kc_casefold' || ($case === 'fold' && $form === 'kc'))
{
$string = $smcFunc['normalize']($string, 'kc_casefold');
Expand Down
6 changes: 3 additions & 3 deletions Sources/ManageAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ function BrowseFiles()
),
'additional_rows' => array(
array(
'position' => 'above_table_headers',
'position' => 'above_column_headers',
'value' => '<input type="submit" name="remove_submit" class="button you_sure" value="' . $txt['quickmod_delete_selected'] . '" data-confirm="' . $txt['confirm_delete_attachments'] . '">',
),
array(
Expand Down Expand Up @@ -2609,7 +2609,7 @@ function attachDirStatus($dir, $expected_files)
}

/**
* Maintance function to move attachments from one directory to another
* Maintenance function to move attachments from one directory to another
*/
function TransferAttachments()
{
Expand Down Expand Up @@ -2642,7 +2642,7 @@ function TransferAttachments()

if (empty($results))
{
// Get the total file count for the progess bar.
// Get the total file count for the progress bar.
$request = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}attachments
Expand Down
8 changes: 4 additions & 4 deletions Sources/ManageBans.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* Ban center. The main entrance point for all ban center functions.
* It is accesssed by ?action=admin;area=ban.
* It is accessed by ?action=admin;area=ban.
* It choses a function based on the 'sa' parameter, like many others.
* The default sub-action is BanList().
* It requires the ban_members permission.
Expand Down Expand Up @@ -471,13 +471,13 @@ function BanEdit()
),
'additional_rows' => array(
array(
'position' => 'above_table_headers',
'position' => 'above_column_headers',
'value' => '
<input type="submit" name="remove_selection" value="' . $txt['ban_remove_selected_triggers'] . '" class="button"> <a class="button" href="' . $scripturl . '?action=admin;area=ban;sa=edittrigger;bg=' . $ban_group_id . '">' . $txt['ban_add_trigger'] . '</a>',
'style' => 'text-align: right;',
),
array(
'position' => 'above_table_headers',
'position' => 'above_column_headers',
'value' => '
<input type="hidden" name="bg" value="' . $ban_group_id . '">
<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
Expand Down Expand Up @@ -1474,7 +1474,7 @@ function logTriggersUpdates($logs, $new = true, $removal = false)
'ip_range' => 'ip_range',
);

// Log the addion of the ban entries into the moderation log.
// Log the addition of the ban entries into the moderation log.
foreach ($logs as $log)
logAction('ban' . ($removal == true ? 'remove' : ''), array(
$log_name_map[$log['bantype']] => $log['value'],
Expand Down
Loading

0 comments on commit 3168adb

Please sign in to comment.