Merge "Use \d shortcut in regular expressions"

This commit is contained in:
jenkins-bot 2018-11-21 18:13:00 +00:00 committed by Gerrit Code Review
commit 1fe6947693

View file

@ -340,8 +340,8 @@ class Cite {
return $this->error( 'cite_error_ref_no_key' );
}
if ( is_string( $key ) && preg_match( '/^[0-9]+$/', $key ) ||
is_string( $follow ) && preg_match( '/^[0-9]+$/', $follow )
if ( is_string( $key ) && preg_match( '/^\d+$/', $key ) ||
is_string( $follow ) && preg_match( '/^\d+$/', $follow )
) {
# Numeric names mess up the resulting id's, potentially produ-
# cing duplicate id's in the XHTML. The Right Thing To Do