r50000 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49999‎ | r50000 | r50001 >
Date:11:42, 28 April 2009
Author:catrope
Status:ok (Comments)
Tags:
Comment:
API: (bug 16422) Don't show help in format=jsonfm unless specifically requested with action=help
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiFormatJson.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFormatBase.php
@@ -100,6 +100,16 @@
101101 public function getIsHtml() {
102102 return $this->mIsHtml;
103103 }
 104+
 105+ /**
 106+ * Whether this formatter can format the help message in a nice way.
 107+ * By default, this returns the same as getIsHtml().
 108+ * When action=help is set explicitly, the help will always be shown
 109+ * @return bool
 110+ */
 111+ public function getWantsHelp() {
 112+ return $this->getIsHtml();
 113+ }
104114
105115 /**
106116 * Initialize the printer function and prepare the output headers, etc.
Index: trunk/phase3/includes/api/ApiFormatJson.php
@@ -47,6 +47,11 @@
4848 public function getNeedsRawData() {
4949 return $this->mIsRaw;
5050 }
 51+
 52+ public function getWantsHelp() {
 53+ // Help is always ugly in JSON
 54+ return false;
 55+ }
5156
5257 public function execute() {
5358 $prefix = $suffix = "";
Index: trunk/phase3/includes/api/ApiMain.php
@@ -311,7 +311,7 @@
312312 'info' => $e->getMessage());
313313
314314 // Only print the help message when this is for the developer, not runtime
315 - if ($this->mPrinter->getIsHtml() || $this->mAction == 'help')
 315+ if ($this->mPrinter->getWantsHelp() || $this->mAction == 'help')
316316 ApiResult :: setContent($errMessage, $this->makeHelpMsg());
317317
318318 } else {
Index: trunk/phase3/RELEASE-NOTES
@@ -434,6 +434,7 @@
435435 * (bug 13049) "API must be accessed from the primary script entry point" error
436436 * (bug 18601) generator=backlinks returns invalid continue parameter
437437 * (bug 18597) Internal error with empty generator= parameter
 438+* (bug 16422) Don't display help for format=jsonfm unless specifically requested
438439
439440 === Languages updated in 1.15 ===
440441

Comments

#Comment by Werdna (talk | contribs)   23:46, 28 April 2009

Commit #50000!!!!!

Status & tagging log