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:
1664807
)
ApiHelp: Avoid header for example, when there no examples
author
umherirrender
<umherirrender_de.wp@web.de>
Sun, 26 May 2013 18:48:17 +0000
(20:48 +0200)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Tue, 28 May 2013 15:37:41 +0000
(15:37 +0000)
When writing a new extension the source:
public function getExamples() {
return array(
//TODO
);
}
would produce a empty "Example:" header on the help page. Avoid this, by
changing the condition to check for truthy instead of false and empty
string.
Change-Id: I67ecacbbac66b97ed96412abf79b49aebe0ebdbf
includes/api/ApiBase.php
patch
|
blob
|
history
diff --git
a/includes/api/ApiBase.php
b/includes/api/ApiBase.php
index
7e7365f
..
c8b05e8
100644
(file)
--- a/
includes/api/ApiBase.php
+++ b/
includes/api/ApiBase.php
@@
-304,7
+304,7
@@
abstract class ApiBase extends ContextSource {
}
$examples = $this->getExamples();
- if ( $examples
!== false && $examples !== ''
) {
+ if ( $examples ) {
if ( !is_array( $examples ) ) {
$examples = array(
$examples