jenkins-bot has submitted this change and it was merged.
Change subject: Fix HOLDS RegEx eating non-identifier characters when replacing
field name
......................................................................
Fix HOLDS RegEx eating non-identifier characters when replacing field name
Fix HOLDS RegEx eating non-identifier characters when replacing field name
Change-Id: Iebd2cdaa294a4f97022da87a89d90d79d111de90
Fix HOLDS RegEx eating non-identifier characters when replacing field name
Fix HOLDS RegEx eating non-identifier characters when replacing field name.
This small edit uses the prettier \b instead of \\b.
Change-Id: Iebd2cdaa294a4f97022da87a89d90d79d111de90
---
M CargoSQLQuery.php
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Yaron Koren: Checked; Looks good to me, approved
jenkins-bot: Verified
diff --git a/CargoSQLQuery.php b/CargoSQLQuery.php
index 69c30ea..23722ee 100644
--- a/CargoSQLQuery.php
+++ b/CargoSQLQuery.php
@@ -593,6 +593,7 @@
$fieldName = $virtualField['fieldName'];
$tableName = $virtualField['tableName'];
$foundLikeMatch1 = $foundMatch1 = $foundLikeMatch2 =
$foundMatch2 = false;
+ $likePattern1 = $likePattern2 = '';
$patternSuffix = '\s+(HOLDS)\s+(LIKE)?/i';
$throwException = false;
@@ -631,6 +632,9 @@
'table2' => $fieldTableName,
'field2' => '_rowID'
);
+ $likePattern1 = str_replace( '([^\w$.]|^)',
'\b', $likePattern1);
+ $likePattern2 = str_replace( '([^\w$.]|^)',
'\b', $likePattern2);
+
if ( $foundLikeMatch1 ) {
$this->mWhereStr = preg_replace(
$likePattern1, "$fieldTableName._value LIKE ",
$this->mWhereStr );
--
To view, visit https://gerrit.wikimedia.org/r/260531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iebd2cdaa294a4f97022da87a89d90d79d111de90
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Ed Hoo <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits