Permalink
Browse files

Order by COUNT (thanks to paranoiq)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1000 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent c7f2ace commit 821d040d6c968a70bf38ef5ec124114fab75f8dd jakubvrana committed Aug 24, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 adminer/include/adminer.inc.php
@@ -301,7 +301,7 @@ function selectSearchProcess($fields, $indexes) {
function selectOrderProcess($fields, $indexes) {
$return = array();
foreach ((array) $_GET["order"] as $key => $val) {
- if (isset($fields[$val]) || preg_match('~^[A-Z0-9_]+\\(`(?:[^`]|``)+`\\)$~', $val)) {
+ if (isset($fields[$val]) || preg_match('~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()`(?:[^`]|``)+`\\)|COUNT\\(\\*\\))$~', $val)) {
$return[] = idf_escape($val) . (isset($_GET["desc"][$key]) ? " DESC" : "");
}
}

0 comments on commit 821d040

Please sign in to comment.