From: Aryeh Gregor Date: Tue, 30 Dec 2008 20:34:19 +0000 (+0000) Subject: Fix PHP notice X-Git-Tag: 1.31.0-rc.0~43689 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=2f7bec8f74c922e825f6e4f893607db4106d5f4a;p=lhc%2Fweb%2Fwiklou.git Fix PHP notice It would seem like something is passing empty strings to Sanitizer::escapeId(). A more explicit check for this might be useful, but this should avoid the notice. --- diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index e207f83da7..a315ed4cd3 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -802,7 +802,7 @@ class Sanitizer { $id = urlencode( Sanitizer::decodeCharReferences( strtr( $id, ' ', '_' ) ) ); $id = str_replace( array_keys( $replace ), array_values( $replace ), $id ); - if ( preg_match( '/[^a-zA-Z]/', $id[0] ) + if ( !preg_match( '/^[a-zA-Z]/', $id ) && !in_array( 'noninitial', $options ) ) { // Initial character must be a letter! $id = "x$id";