mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 09:52:29 +02:00
Quote 'rank' field name in SQL
Add backticks to reserved word 'rank' in SQL queries. Bug: GH #919
This commit is contained in:
committed by
Pierrick Le Gall
parent
af85a62199
commit
8e9cb6de23
+2
-2
@@ -295,7 +295,7 @@ $template->assign(array(
|
||||
$categories = array();
|
||||
|
||||
$query = '
|
||||
SELECT id, name, permalink, dir, rank, status
|
||||
SELECT id, name, permalink, dir, `rank`, status
|
||||
FROM '.CATEGORIES_TABLE;
|
||||
if (!isset($_GET['parent_id']))
|
||||
{
|
||||
@@ -308,7 +308,7 @@ else
|
||||
WHERE id_uppercat = '.$_GET['parent_id'];
|
||||
}
|
||||
$query.= '
|
||||
ORDER BY rank ASC
|
||||
ORDER BY `rank` ASC
|
||||
;';
|
||||
$categories = hash_from_query($query, 'id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user