mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-27 16:50:00 +00:00
SECURITY: Improve regular expression performance
* This patch improves the performance of an ext:Gadgets regular expression which helps parse out sections of the gadgets definition page. Bug: T363773 Change-Id: Ic9e1a181b261ae4d25e9ce2f91ad12f92e9855d9
This commit is contained in:
parent
5dbf7bce92
commit
f2bc65a518
|
@ -198,7 +198,7 @@ class MediaWikiGadgetsDefinitionRepo extends GadgetRepo {
|
|||
|
||||
foreach ( $lines as $line ) {
|
||||
$m = [];
|
||||
if ( preg_match( '/^==+ *([^*:\s|]+?)\s*==+\s*$/', $line, $m ) ) {
|
||||
if ( preg_match( '/^==+ *([^*:\s|]+)\s*(?<!=)==+\s*$/', $line, $m ) ) {
|
||||
$section = $m[1];
|
||||
} else {
|
||||
$gadget = $this->newFromDefinition( $line, $section );
|
||||
|
|
Loading…
Reference in a new issue