mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Don't call the size function count() as part of a test condition in loops. Compute the size beforehand, and not on each iteration.
Scrutinizer added a Performance label: these are the only violations. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -633,9 +633,9 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals
|
||||
// Now re-encode everything except &entity;
|
||||
$string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
|
||||
for ( $i = 0; $i < count( $string ); $i += 2 )
|
||||
for ( $i = 0, $c = count( $string ); $i < $c; $i += 2 ) {
|
||||
$string[$i] = @htmlspecialchars( $string[$i], $quote_style, $charset );
|
||||
|
||||
}
|
||||
$string = implode( '', $string );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user