Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2016-09-16 11:27:33 +0300
committerMichal Čihař <michal@cihar.com>2016-09-16 11:29:21 +0300
commit3546bed47e51ad8bec18b6680aeaf6c031808d5e (patch)
tree7c42cd49875a42088aa511e9eeb797308fa26cb0 /sql.php
parent6e3d38a1d31c780722b0ed6f3dbf2a5c238c6dad (diff)
Avoid using mb_strlen for checking whether string is empty
Using strlen produces same results here, just way faster. Fixes #12397 Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'sql.php')
-rw-r--r--sql.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql.php b/sql.php
index 6e6257b732..211e73c672 100644
--- a/sql.php
+++ b/sql.php
@@ -62,7 +62,7 @@ if (! isset($err_url)) {
$err_url = (! empty($back) ? $back : $goto)
. '?' . URL::getCommon(array('db' => $GLOBALS['db']))
. ((mb_strpos(' ' . $goto, 'db_') != 1
- && mb_strlen($table))
+ && strlen($table) > 0)
? '&amp;table=' . urlencode($table)
: ''
);
@@ -122,9 +122,7 @@ if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
// Default to browse if no query set and we have table
// (needed for browsing from DefaultTabTable)
-$tableLength = mb_strlen($table);
-$dbLength = mb_strlen($db);
-if (empty($sql_query) && $tableLength && $dbLength) {
+if (empty($sql_query) && strlen($table) > 0 && strlen($db) > 0) {
$sql_query = PMA_getDefaultSqlQueryForBrowse($db, $table);
// set $goto to what will be displayed if query returns 0 rows