Merge "SECURITY: Improve regular expression performance" into REL1_39

This commit is contained in:
jenkins-bot 2024-06-04 15:02:28 +00:00 committed by Gerrit Code Review
commit dd8489deee

View file

@ -173,7 +173,7 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
foreach ( $lines as $line ) { foreach ( $lines as $line ) {
$m = []; $m = [];
if ( preg_match( '/^==+ *([^*:\s|]+?)\s*==+\s*$/', $line, $m ) ) { if ( preg_match( '/^==+ *([^*:\s|]+)\s*(?<!=)==+\s*$/', $line, $m ) ) {
$section = $m[1]; $section = $m[1];
} else { } else {
$gadget = $this->newFromDefinition( $line, $section ); $gadget = $this->newFromDefinition( $line, $section );