Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix handling of unknown sort order.

  • Loading branch information...
commit 533e10213590e7ccd83b98a5cd19ba1c3be119dd 1 parent ea3b718
Michal Čihař authored August 17, 2010

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  libraries/database_interface.lib.php
4  libraries/database_interface.lib.php
@@ -205,6 +205,10 @@ function PMA_usort_comparison_callback($a, $b)
205 205
     } else {
206 206
         $sorter = 'strcasecmp';
207 207
     }
  208
+    /* No sorting when key is not present */
  209
+    if (!isset($a[$GLOBALS['callback_sort_by']]) || ! isset($b[$GLOBALS['callback_sort_by']])) {
  210
+        return 0;
  211
+    }
208 212
     // produces f.e.:
209 213
     // return -1 * strnatcasecmp($a["SCHEMA_TABLES"], $b["SCHEMA_TABLES"])
210 214
     return ($GLOBALS['callback_sort_order'] == 'ASC' ? 1 : -1) * $sorter($a[$GLOBALS['callback_sort_by']], $b[$GLOBALS['callback_sort_by']]);

0 notes on commit 533e102

Please sign in to comment.
Something went wrong with that request. Please try again.