From e438e64edc5fbb2c703e44d29cb332eed71e492c Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Wed, 27 Aug 2008 14:34:21 +0000 Subject: [PATCH] Allow order by COUNT(*) git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@458 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- design.inc.php | 2 +- select.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/design.inc.php b/design.inc.php index a4fedcf3..8facaebe 100644 --- a/design.inc.php +++ b/design.inc.php @@ -9,7 +9,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { -<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.7.0-dev"; ?> +<?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('phpMinAdmin') . " 1.7.1-dev"; ?> diff --git a/select.inc.php b/select.inc.php index 4ee849f4..facbff13 100644 --- a/select.inc.php +++ b/select.inc.php @@ -51,7 +51,7 @@ $order = array(); foreach ((array) $_GET["order"] as $key => $val) { if (in_array($val, $columns, true)) { $order[] = idf_escape($val) . (isset($_GET["desc"][$key]) ? " DESC" : ""); - } elseif (preg_match('(^(' . strtoupper(implode('|', $functions) . '|' . implode('|', $grouping)) . ')\\((' . implode('|', array_map('preg_quote', array_map('idf_escape', $columns))) . ')\\)$)', $val)) { + } elseif (preg_match('(^(COUNT\\(\\*\\)|(' . strtoupper(implode('|', $functions) . '|' . implode('|', $grouping)) . ')\\((' . implode('|', array_map('preg_quote', array_map('idf_escape', $columns))) . ')\\))$)', $val)) { $order[] = $val . (isset($_GET["desc"][$key]) ? " DESC" : ""); } }