dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Revert "Log the reason why revision->getContent() returns null""
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryCategories.php
diff --git
a/includes/api/ApiQueryCategories.php
b/includes/api/ApiQueryCategories.php
index
c4428d5
..
7b447cb
100644
(file)
--- a/
includes/api/ApiQueryCategories.php
+++ b/
includes/api/ApiQueryCategories.php
@@
-1,9
+1,5
@@
<?php
/**
<?php
/**
- *
- *
- * Created on May 13, 2007
- *
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
@@
-69,7
+65,7
@@
class ApiQueryCategories extends ApiQueryGeneratorBase {
$this->addTables( 'categorylinks' );
$this->addWhereFld( 'cl_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
$this->addTables( 'categorylinks' );
$this->addWhereFld( 'cl_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
- if (
!is_null( $params['categories'] )
) {
+ if (
$params['categories']
) {
$cats = [];
foreach ( $params['categories'] as $cat ) {
$title = Title::newFromText( $cat );
$cats = [];
foreach ( $params['categories'] as $cat ) {
$title = Title::newFromText( $cat );
@@
-79,6
+75,10
@@
class ApiQueryCategories extends ApiQueryGeneratorBase {
$cats[] = $title->getDBkey();
}
}
$cats[] = $title->getDBkey();
}
}
+ if ( !$cats ) {
+ // No titles so no results
+ return;
+ }
$this->addWhereFld( 'cl_to', $cats );
}
$this->addWhereFld( 'cl_to', $cats );
}