dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43b8386
)
Use $db->conditional() instead of non-standard IF(). Fixes bug 13430.
author
Greg Sabino Mullane
<greg@users.mediawiki.org>
Wed, 19 Mar 2008 13:15:09 +0000
(13:15 +0000)
committer
Greg Sabino Mullane
<greg@users.mediawiki.org>
Wed, 19 Mar 2008 13:15:09 +0000
(13:15 +0000)
includes/Category.php
patch
|
blob
|
history
diff --git
a/includes/Category.php
b/includes/Category.php
index
98c65a1
..
e924b5e
100644
(file)
--- a/
includes/Category.php
+++ b/
includes/Category.php
@@
-273,11
+273,13
@@
class Category extends CategoryListBase {
);
}
+ $cond1 = $dbw->conditional( 'page_namespace='.NS_CATEGORY, 1, 'NULL' );
+ $cond2 = $dbw->conditional( 'page_namespace='.NS_IMAGE, 1, 'NULL' );
$result = $dbw->selectRow(
array( 'categorylinks', 'page' ),
array( 'COUNT(*) AS pages',
-
'COUNT(IF(page_namespace='.NS_CATEGORY.',1,NULL)) AS subcats'
,
- 'COUNT(IF(page_namespace='.NS_IMAGE.',1,NULL)) AS files'
+
"COUNT($cond1) AS subcats"
,
+ "COUNT($cond2) AS files"
),
array( 'cl_to' => $this->mNames[0], 'page_id = cl_from' ),
__METHOD__,