diff options
author | Michal Čihař <michal@cihar.com> | 2016-09-16 11:27:33 +0300 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2016-09-16 11:29:21 +0300 |
commit | 3546bed47e51ad8bec18b6680aeaf6c031808d5e (patch) | |
tree | 7c42cd49875a42088aa511e9eeb797308fa26cb0 /sql.php | |
parent | 6e3d38a1d31c780722b0ed6f3dbf2a5c238c6dad (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.php | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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) ? '&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 |