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.
$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";