r88432 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88431‎ | r88432 | r88433 >
Date:21:43, 19 May 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Per NikeRabbit on r88174, allow capitals in the regex
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -186,7 +186,7 @@
187187 * @return bool
188188 */
189189 public static function validateSha1Hash( $hash ) {
190 - return preg_match( '/[a-f0-9]{40}/', $hash );
 190+ return preg_match( '/[a-fA-F0-9]{40}/', $hash );
191191 }
192192
193193 /**
@@ -194,7 +194,7 @@
195195 * @return bool
196196 */
197197 public static function validateSha1Base36Hash( $hash ) {
198 - return preg_match( '/[a-z0-9]{31}/', $hash );
 198+ return preg_match( '/[a-zA-Z0-9]{31}/', $hash );
199199 }
200200
201201 public function getAllowedParams() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88174* (bug 27593) API: add error message when sha1/sha1base36 is invalidreedy13:16, 15 May 2011

Comments

#Comment by Bryan (talk | contribs)   13:42, 21 May 2011

Doesn't that mean that you need to do strtolower in the database query?

Status & tagging log