r13305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13304‎ | r13305 | r13306 >
Date:16:49, 24 March 2006
Author:gabrielwicke
Status:old
Tags:
Comment:
Validate html ids properly, prefix if necessary
Modified paths:
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Sanitizer.php
@@ -622,6 +622,9 @@
623623 );
624624
625625 $id = urlencode( Sanitizer::decodeCharReferences( strtr( $id, ' ', '_' ) ) );
 626+ # *must* start with letters (a-zA-Z), so prefix with something
 627+ # informative
 628+ $id = preg_replace('/^([0-9])/','iHaveToStartWithALetter-\\1', $id);
626629
627630 return str_replace( array_keys( $replace ), array_values( $replace ), $id );
628631 }

Status & tagging log