mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-08 05:51:14 -07:00
'(mb_)substr(...)' used as index-based access.
This commit is contained in:
parent
9a96dc6fb9
commit
e89f0173d8
5 changed files with 8 additions and 8 deletions
|
@ -83,7 +83,7 @@ function init_display_template($template_var, $replacement, $filename = 'viewtop
|
|||
}
|
||||
|
||||
$complete_filename = $filename;
|
||||
if (substr($complete_filename, 0, 1) != '/') {
|
||||
if ($complete_filename[0] != '/') {
|
||||
$complete_filename = $template->root . '/' . $complete_filename;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ function base64_unpack($string)
|
|||
|
||||
for ($i = 1; $i <= $length; $i++) {
|
||||
$pos = $length - $i;
|
||||
$operand = strpos($chars, substr($string, $pos, 1));
|
||||
$operand = strpos($chars, $string[$pos]);
|
||||
$exponent = $base ** ($i - 1);
|
||||
$decValue = $operand * $exponent;
|
||||
$number += $decValue;
|
||||
|
@ -131,7 +131,7 @@ function auth_unpack($auth_cache)
|
|||
$auth_len = 1;
|
||||
|
||||
for ($pos = 0; $pos < strlen($auth_cache); $pos += $auth_len) {
|
||||
$forum_auth = substr($auth_cache, $pos, 1);
|
||||
$forum_auth = $auth_cache[$pos];
|
||||
if ($forum_auth == $one_char_encoding) {
|
||||
$auth_len = 1;
|
||||
continue;
|
||||
|
@ -166,7 +166,7 @@ function is_forum_authed($auth_cache, $check_forum_id)
|
|||
$auth_len = 1;
|
||||
|
||||
for ($pos = 0; $pos < strlen($auth_cache); $pos += $auth_len) {
|
||||
$forum_auth = substr($auth_cache, $pos, 1);
|
||||
$forum_auth = $auth_cache[$pos];
|
||||
if ($forum_auth == $one_char_encoding) {
|
||||
$auth_len = 1;
|
||||
continue;
|
||||
|
|
|
@ -2956,7 +2956,7 @@ class Text_LangCorrect
|
|||
*/
|
||||
|
||||
#0a. английский --> русский:
|
||||
if (substr($word, 1, 1) === '.' #оптимизация
|
||||
if ($word[1] === '.' #оптимизация
|
||||
&& preg_match('/^ ( ' . $this->en_similar_uc . '\. #первый инициал
|
||||
(?:' . $this->en_similar_uc . '\.)? #второй инициал (необязательно)
|
||||
) #1 инициалы
|
||||
|
@ -2973,7 +2973,7 @@ class Text_LangCorrect
|
|||
}
|
||||
|
||||
#0b. русский --> английский:
|
||||
if (substr($word, 2, 1) === '.' #оптимизация
|
||||
if ($word[2] === '.' #оптимизация
|
||||
&& preg_match('/^ ( ' . $this->ru_similar_uc . '\. #первый инициал
|
||||
(?:' . $this->ru_similar_uc . '\.)? #второй инициал (необязательно)
|
||||
) #1 инициалы
|
||||
|
|
|
@ -32,7 +32,7 @@ define('SMTP_INCLUDED', 1);
|
|||
function server_parse($socket, $response, $line = __LINE__)
|
||||
{
|
||||
$server_response = '';
|
||||
while (substr($server_response, 3, 1) != ' ') {
|
||||
while ($server_response[3] != ' ') {
|
||||
if (!($server_response = fgets($socket, 256))) {
|
||||
bb_die('Could not get mail server response codes');
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ class template
|
|||
$filename = $this->replace[$filename];
|
||||
}
|
||||
// Check if it's an absolute or relative path.
|
||||
if ((substr($filename, 0, 1) !== '/') && (substr($filename, 1, 1) !== ':')) {
|
||||
if (($filename[0] !== '/') && ($filename[1] !== ':')) {
|
||||
return $this->root . '/' . $filename;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue