Skip to content

Commit 55b317c

Browse files
committed
Remove /*overload*/ prefix from mb_* calls
I believe this was temporary flagging to see which code is migrated and can be safely removed now. Signed-off-by: Michal Čihař <[email protected]>
1 parent 41caf7b commit 55b317c

140 files changed

Lines changed: 894 additions & 966 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

db_operations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
/**
3838
* Rename/move or copy database
3939
*/
40-
if (/*overload*/mb_strlen($GLOBALS['db'])
40+
if (mb_strlen($GLOBALS['db'])
4141
&& (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
4242
) {
4343
if (! empty($_REQUEST['db_rename'])) {
@@ -47,7 +47,7 @@
4747
}
4848

4949
if (! isset($_REQUEST['newname'])
50-
|| ! /*overload*/mb_strlen($_REQUEST['newname'])
50+
|| ! mb_strlen($_REQUEST['newname'])
5151
) {
5252
$message = PMA\libraries\Message::error(__('The database name is empty!'));
5353
} else {

examples/openid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function Show_page($contents)
7979

8080
$realm = $base . '/';
8181
$returnTo = $base . dirname($_SERVER['PHP_SELF']);
82-
if ($returnTo[/*overload*/mb_strlen($returnTo) - 1] != '/') {
82+
if ($returnTo[mb_strlen($returnTo) - 1] != '/') {
8383
$returnTo .= '/';
8484
}
8585
$returnTo .= 'openid.php';

export.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
if ($export_type == 'server') {
255255
$err_url = 'server_export.php' . PMA_URL_getCommon();
256256
} elseif ($export_type == 'database'
257-
&& /*overload*/mb_strlen($db)
257+
&& mb_strlen($db)
258258
) {
259259
$err_url = 'db_export.php' . PMA_URL_getCommon(array('db' => $db));
260260
// Check if we have something to export
@@ -263,8 +263,8 @@
263263
} else {
264264
$tables = array();
265265
}
266-
} elseif ($export_type == 'table' && /*overload*/mb_strlen($db)
267-
&& /*overload*/mb_strlen($table)
266+
} elseif ($export_type == 'table' && mb_strlen($db)
267+
&& mb_strlen($table)
268268
) {
269269
$err_url = 'tbl_export.php' . PMA_URL_getCommon(
270270
array(

file_echo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343

4444
/* Decode data */
4545
if ($extension != 'svg') {
46-
$data = /*overload*/mb_substr(
46+
$data = mb_substr(
4747
$_REQUEST['image'],
48-
/*overload*/mb_strpos($_REQUEST['image'], ',') + 1
48+
mb_strpos($_REQUEST['image'], ',') + 1
4949
);
5050
$data = base64_decode($data);
5151
} else {
@@ -56,7 +56,7 @@
5656
PMA_downloadHeader(
5757
$filename,
5858
$_REQUEST['type'],
59-
/*overload*/mb_strlen($data)
59+
mb_strlen($data)
6060
);
6161

6262
/* Send data */

gis_data_editor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ function escape($variable)
4343
// Extract from field's values if available, if not use the column type passed.
4444
if (! isset($gis_data['gis_type'])) {
4545
if (isset($_REQUEST['type']) && $_REQUEST['type'] != '') {
46-
$gis_data['gis_type'] = /*overload*/mb_strtoupper($_REQUEST['type']);
46+
$gis_data['gis_type'] = mb_strtoupper($_REQUEST['type']);
4747
}
4848
if (isset($_REQUEST['value']) && trim($_REQUEST['value']) != '') {
4949
$start = (substr($_REQUEST['value'], 0, 1) == "'") ? 1 : 0;
50-
$gis_data['gis_type'] = /*overload*/mb_substr(
50+
$gis_data['gis_type'] = mb_substr(
5151
$_REQUEST['value'],
5252
$start,
53-
/*overload*/mb_strpos($_REQUEST['value'], "(") - $start
53+
mb_strpos($_REQUEST['value'], "(") - $start
5454
);
5555
}
5656
if ((! isset($gis_data['gis_type']))

import.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,17 @@
257257
$goto = 'server_import.php';
258258
} else {
259259
if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) {
260-
if (/*overload*/mb_strlen($table) && /*overload*/mb_strlen($db)) {
260+
if (mb_strlen($table) && mb_strlen($db)) {
261261
$goto = 'tbl_structure.php';
262-
} elseif (/*overload*/mb_strlen($db)) {
262+
} elseif (mb_strlen($db)) {
263263
$goto = 'db_structure.php';
264264
} else {
265265
$goto = 'server_sql.php';
266266
}
267267
}
268-
if (/*overload*/mb_strlen($table) && /*overload*/mb_strlen($db)) {
268+
if (mb_strlen($table) && mb_strlen($db)) {
269269
$common = PMA_URL_getCommon(array('db' => $db, 'table' => $table));
270-
} elseif (/*overload*/mb_strlen($db)) {
270+
} elseif (mb_strlen($db)) {
271271
$common = PMA_URL_getCommon(array('db' => $db));
272272
} else {
273273
$common = PMA_URL_getCommon();
@@ -285,7 +285,7 @@
285285
}
286286

287287

288-
if (/*overload*/mb_strlen($db)) {
288+
if (mb_strlen($db)) {
289289
$GLOBALS['dbi']->selectDb($db);
290290
}
291291

@@ -407,7 +407,7 @@
407407
}
408408

409409
// Calculate value of the limit
410-
$memoryUnit = /*overload*/mb_strtolower(substr($memory_limit, -1));
410+
$memoryUnit = mb_strtolower(substr($memory_limit, -1));
411411
if ('m' == $memoryUnit) {
412412
$memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;
413413
} elseif ('k' == $memoryUnit) {
@@ -729,7 +729,7 @@
729729
// in case of a query typed in the query window
730730
// (but if the query is too large, in case of an imported file, the parser
731731
// can choke on it so avoid parsing)
732-
$sqlLength = /*overload*/mb_strlen($sql_query);
732+
$sqlLength = mb_strlen($sql_query);
733733
if ($sqlLength <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
734734
include_once 'libraries/parse_analyze.lib.php';
735735

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@
591591
) {
592592
$_client_info = $GLOBALS['dbi']->getClientInfo();
593593
if ($server > 0
594-
&& /*overload*/mb_strpos($_client_info, 'mysqlnd') === false
595-
&& /*overload*/mb_strpos(PMA_MYSQL_STR_VERSION, 'MariaDB') === false
594+
&& mb_strpos($_client_info, 'mysqlnd') === false
595+
&& mb_strpos(PMA_MYSQL_STR_VERSION, 'MariaDB') === false
596596
&& substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(
597597
PMA_MYSQL_INT_VERSION, 0, 3
598598
)

libraries/Advisor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public static function parseRulesFile()
529529
continue;
530530
}
531531
$rules[$ruleNo][$ruleSyntax[$ruleLine]] = chop(
532-
/*overload*/mb_substr($line, 1)
532+
mb_substr($line, 1)
533533
);
534534
$lines[$ruleNo][$ruleSyntax[$ruleLine]] = $i + 1;
535535
++$ruleLine;

libraries/Config.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,15 @@ public function checkOutputCompression()
168168
*/
169169
private function _setClientPlatform($user_agent)
170170
{
171-
if (/*overload*/mb_strstr($user_agent, 'Win')) {
171+
if (mb_strstr($user_agent, 'Win')) {
172172
$this->set('PMA_USR_OS', 'Win');
173-
} elseif (/*overload*/mb_strstr($user_agent, 'Mac')) {
173+
} elseif (mb_strstr($user_agent, 'Mac')) {
174174
$this->set('PMA_USR_OS', 'Mac');
175-
} elseif (/*overload*/mb_strstr($user_agent, 'Linux')) {
175+
} elseif (mb_strstr($user_agent, 'Linux')) {
176176
$this->set('PMA_USR_OS', 'Linux');
177-
} elseif (/*overload*/mb_strstr($user_agent, 'Unix')) {
177+
} elseif (mb_strstr($user_agent, 'Unix')) {
178178
$this->set('PMA_USR_OS', 'Unix');
179-
} elseif (/*overload*/mb_strstr($user_agent, 'OS/2')) {
179+
} elseif (mb_strstr($user_agent, 'OS/2')) {
180180
$this->set('PMA_USR_OS', 'OS/2');
181181
} else {
182182
$this->set('PMA_USR_OS', 'Other');
@@ -271,7 +271,7 @@ public function checkClient()
271271
);
272272
$this->set('PMA_USR_BROWSER_AGENT', 'SAFARI');
273273
// Firefox
274-
} elseif (! /*overload*/mb_strstr($HTTP_USER_AGENT, 'compatible')
274+
} elseif (! mb_strstr($HTTP_USER_AGENT, 'compatible')
275275
&& preg_match('@Firefox/([\w.]+)@', $HTTP_USER_AGENT, $log_version)
276276
) {
277277
$this->set(
@@ -314,7 +314,7 @@ public function checkGd2()
314314

315315
if (@function_exists('gd_info')) {
316316
$gd_nfo = gd_info();
317-
if (/*overload*/mb_strstr($gd_nfo["GD Version"], '2.')) {
317+
if (mb_strstr($gd_nfo["GD Version"], '2.')) {
318318
$this->set('PMA_IS_GD2', 1);
319319
} else {
320320
$this->set('PMA_IS_GD2', 0);
@@ -449,10 +449,10 @@ public function checkGitRevision()
449449

450450
$branch = false;
451451
// are we on any branch?
452-
if (/*overload*/mb_strstr($ref_head, '/')) {
453-
$ref_head = /*overload*/mb_substr(trim($ref_head), 5);
452+
if (mb_strstr($ref_head, '/')) {
453+
$ref_head = mb_substr(trim($ref_head), 5);
454454
if (substr($ref_head, 0, 11) === 'refs/heads/') {
455-
$branch = /*overload*/mb_substr($ref_head, 11);
455+
$branch = mb_substr($ref_head, 11);
456456
} else {
457457
$branch = basename($ref_head);
458458
}
@@ -1306,7 +1306,7 @@ public function checkPmaAbsoluteUri()
13061306
$pma_absolute_uri = $this->get('PmaAbsoluteUri');
13071307
$is_https = $this->detectHttps();
13081308

1309-
if (/*overload*/mb_strlen($pma_absolute_uri) < 5) {
1309+
if (mb_strlen($pma_absolute_uri) < 5) {
13101310
$url = array();
13111311

13121312
// If we don't have scheme, we didn't have full URL so we need to
@@ -1407,7 +1407,7 @@ public function checkPmaAbsoluteUri()
14071407
$path = '';
14081408
}
14091409
// in vhost situations, there could be already an ending slash
1410-
if (/*overload*/mb_substr($path, -1) != '/') {
1410+
if (mb_substr($path, -1) != '/') {
14111411
$path .= '/';
14121412
}
14131413
$pma_absolute_uri .= $path;
@@ -1429,20 +1429,20 @@ public function checkPmaAbsoluteUri()
14291429

14301430
// Adds a trailing slash et the end of the phpMyAdmin uri if it
14311431
// does not exist.
1432-
if (/*overload*/mb_substr($pma_absolute_uri, -1) != '/') {
1432+
if (mb_substr($pma_absolute_uri, -1) != '/') {
14331433
$pma_absolute_uri .= '/';
14341434
}
14351435

14361436
// If URI doesn't start with http:// or https://, we will add
14371437
// this.
1438-
if (/*overload*/mb_substr($pma_absolute_uri, 0, 7) != 'http://'
1439-
&& /*overload*/mb_substr($pma_absolute_uri, 0, 8) != 'https://'
1438+
if (mb_substr($pma_absolute_uri, 0, 7) != 'http://'
1439+
&& mb_substr($pma_absolute_uri, 0, 8) != 'https://'
14401440
) {
14411441
$pma_absolute_uri
14421442
= ($is_https ? 'https' : 'http')
14431443
. ':'
14441444
. (
1445-
/*overload*/mb_substr($pma_absolute_uri, 0, 2) == '//'
1445+
mb_substr($pma_absolute_uri, 0, 2) == '//'
14461446
? ''
14471447
: '//'
14481448
)
@@ -1588,7 +1588,7 @@ public function isHttps()
15881588

15891589
// CloudFlare Flexible SSL compatibility
15901590
$this->set('force_protocol', in_array(PMA_getenv('HTTP_X_FORWARDED_PROTO'), array('http', 'https'), true));
1591-
1591+
15921592
$is_https = $this->get('force_protocol') ? PMA_getenv('HTTP_X_FORWARDED_PROTO') : isset($url['scheme']) && $url['scheme'] == 'https';
15931593

15941594
$this->set('is_https', $is_https);
@@ -1864,7 +1864,7 @@ public function removeCookie($cookie)
18641864
public function setCookie($cookie, $value, $default = null,
18651865
$validity = null, $httponly = true
18661866
) {
1867-
if (/*overload*/mb_strlen($value) && null !== $default && $value === $default
1867+
if (mb_strlen($value) && null !== $default && $value === $default
18681868
) {
18691869
// default value is used
18701870
if (isset($_COOKIE[$cookie])) {
@@ -1874,7 +1874,7 @@ public function setCookie($cookie, $value, $default = null,
18741874
return false;
18751875
}
18761876

1877-
if (!/*overload*/mb_strlen($value) && isset($_COOKIE[$cookie])) {
1877+
if (!mb_strlen($value) && isset($_COOKIE[$cookie])) {
18781878
// remove cookie, value is empty
18791879
return $this->removeCookie($cookie);
18801880
}

libraries/DatabaseInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,14 +680,14 @@ function ($a, $b) {
680680
return $tables[$database];
681681
}
682682

683-
if (isset($tables[/*overload*/mb_strtolower($database)])) {
683+
if (isset($tables[mb_strtolower($database)])) {
684684
// on windows with lower_case_table_names = 1
685685
// MySQL returns
686686
// with SHOW DATABASES or information_schema.SCHEMATA: `Test`
687687
// but information_schema.TABLES gives `test`
688688
// bug #2036
689689
// https://sourceforge.net/p/phpmyadmin/bugs/2036/
690-
return $tables[/*overload*/mb_strtolower($database)];
690+
return $tables[mb_strtolower($database)];
691691
}
692692

693693
return $tables;
@@ -762,7 +762,7 @@ public function copyTableProperties($tables, $database)
762762
$tables[$table_name]['TABLE_COMMENT']
763763
=& $tables[$table_name]['Comment'];
764764

765-
$commentUpper = /*overload*/mb_strtoupper(
765+
$commentUpper = mb_strtoupper(
766766
$tables[$table_name]['Comment']
767767
);
768768
if ($commentUpper === 'VIEW'

0 commit comments

Comments
 (0)