r41939 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41938‎ | r41939 | r41940 >
Date:17:09, 10 October 2008
Author:vyznev
Status:old
Tags:
Comment:
Use getParameter() for the "maxage" and "smaxage" parameters rather than pulling them straight out of the request
so that they'll be properly validated (and in particular coerced to integers).
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -290,8 +290,8 @@
291291 if($this->mSquidMaxage == -1)
292292 {
293293 # Nobody called setCacheMaxAge(), use the (s)maxage parameters
294 - $smaxage = $this->mRequest->getVal('smaxage', 0);
295 - $maxage = $this->mRequest->getVal('maxage', 0);
 294+ $smaxage = $this->getParameter('smaxage');
 295+ $maxage = $this->getParameter('maxage');
296296 }
297297 else
298298 $smaxage = $maxage = $this->mSquidMaxage;
Index: trunk/phase3/RELEASE-NOTES
@@ -324,6 +324,7 @@
325325 * (bug 15845) Added pageid/fromid parameter to action=delete/move, making
326326 manipulation of legacy pages with invalid titles possible
327327 * (bug 15881) Empty or invalid parameters cause database errors
 328+* The maxage and smaxage parameters are now properly validated
328329
329330 === Languages updated in 1.14 ===
330331

Status & tagging log