r109257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109256‎ | r109257 | r109258 >
Date:00:19, 18 January 2012
Author:awjrichards
Status:ok
Tags:sopa 
Comment:
Made validation slightly stricter
Modified paths:
  • /trunk/extensions/CongressLookup/SpecialCongressLookup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CongressLookup/SpecialCongressLookup.php
@@ -345,12 +345,12 @@
346346 public function isValidZip( $zip ) {
347347 $zipPieces = explode( '-', $zip, 2 );
348348
349 - if ( strlen( $zipPieces[0] ) < 5 || !is_numeric( $zipPieces[0] )) {
 349+ if ( strlen( $zipPieces[0] ) == 5 || !is_numeric( $zipPieces[0] )) {
350350 return false;
351351 }
352352
353353 if ( isset( $zipPieces[1] )) {
354 - if ( strlen( $zipPieces[1] ) < 4 || !is_numeric( $zipPieces[1] )) {
 354+ if ( strlen( $zipPieces[1] ) == 4 || !is_numeric( $zipPieces[1] )) {
355355 return false;
356356 }
357357 }

Status & tagging log