diff --git a/sources/Subs.php b/sources/Subs.php index 85546bf767..5f6cf32025 100644 --- a/sources/Subs.php +++ b/sources/Subs.php @@ -866,7 +866,7 @@ function shorten_text($text, $len = 384, $cutword = false, $buffer = 12) if ($cutword) { // Look for len - buffer characters and cut on first word boundary after - preg_match('~(.{' . ($len - $buffer) . '}.*?)\b~s', $text, $matches); + preg_match('~(.{' . ($len - $buffer) . '}.*?)\b~su', $text, $matches); // Always one clown in the audience who likes long words or not using the spacebar if (Util::strlen($matches[1]) > $len + $buffer) @@ -2130,7 +2130,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra } // Item codes are complicated buggers... they are implicit [li]s and can make [list]s! - if ($smileys !== false && $tag === null && isset($itemcodes[$message[$pos + 1]]) && $message[$pos + 2] == ']' && !isset($disabled['list']) && !isset($disabled['li'])) + if ($smileys !== false && $tag === null && isset($message[$pos + 2]) && isset($itemcodes[$message[$pos + 1]]) && $message[$pos + 2] === ']' && !isset($disabled['list']) && !isset($disabled['li'])) { if ($message[$pos + 1] == '0' && !in_array($message[$pos - 1], array(';', ' ', "\t", "\n", '>'))) continue; @@ -2448,7 +2448,7 @@ function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = arra else $message = strtr($message, array("\n" => '')); - if ($message[0] === ' ') + if (isset($message[0]) && $message[0] === ' ') $message = ' ' . substr($message, 1); // Cleanup whitespace. @@ -3204,7 +3204,7 @@ function template_footer() * * @todo - Note that type="text/javascript" and type="text/css" are deprecated in HTML5. * @todo - There are several occurrences in this function, and the next one. - * @todo - Full directory search for any strays should be done, then hit the lot of them. + * @todo - Full directory search for any strays should be done, then hit the lot of them. */ function template_javascript($do_defered = false) { diff --git a/sources/controllers/Likes.controller.php b/sources/controllers/Likes.controller.php index 832b3e6c55..3b826783a3 100644 --- a/sources/controllers/Likes.controller.php +++ b/sources/controllers/Likes.controller.php @@ -128,7 +128,7 @@ private function prepare_like() } // Past the post threshold? - if (!$user_info['is_admin'] && $user_info['posts'] < $modSettings['likeDisplayLimit']) + if (!$user_info['is_admin'] && !empty($modSettings['likeDisplayLimit']) && $user_info['posts'] < $modSettings['likeDisplayLimit']) $check = false; return $check; diff --git a/sources/subs/Modlog.subs.php b/sources/subs/Modlog.subs.php index d8075aa015..b604dc25c8 100644 --- a/sources/subs/Modlog.subs.php +++ b/sources/subs/Modlog.subs.php @@ -348,7 +348,7 @@ function deleteLogAction($id_log, $time, $delete = null) $db->query('', ' DELETE FROM {db_prefix}log_actions WHERE id_log = {int:moderate_log} - ' . isset($delete) ? 'AND id_action IN ({array_string:delete_actions})' : '' . ' + ' . (isset($delete) ? 'AND id_action IN ({array_string:delete_actions})' : '') . ' AND log_time < {int:twenty_four_hours_wait}', array( 'twenty_four_hours_wait' => time() - $time * 3600,