Yaron Koren has submitted this change and it was merged.
Change subject: Added trimming of whitespaces for "fields", "join on" parameters
......................................................................
Added trimming of whitespaces for "fields", "join on" parameters
Change-Id: Ia97c00de05faea9289eeb133c55a4ffd0609c90e
---
M CargoSQLQuery.php
M CargoUtils.php
2 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
Yaron Koren: Verified; Looks good to me, approved
diff --git a/CargoSQLQuery.php b/CargoSQLQuery.php
index 0a40c10..0dae5e5 100644
--- a/CargoSQLQuery.php
+++ b/CargoSQLQuery.php
@@ -38,7 +38,7 @@
$sqlQuery = new CargoSQLQuery();
$sqlQuery->mTablesStr = $tablesStr;
- $sqlQuery->mTableNames = explode( ',', $tablesStr );
+ $sqlQuery->mTableNames = array_map( 'trim', explode( ',',
$tablesStr ) );
$sqlQuery->mFieldsStr = $fieldsStr;
// This _decode() call is necessary because the "where="
// clause can (and often does) include a call to {{PAGENAME}},
@@ -76,7 +76,7 @@
$sqlQuery = new CargoSQLQuery();
$sqlQuery->mTablesStr = $tablesStr;
- $sqlQuery->mTableNames = explode( ',', $tablesStr );
+ $sqlQuery->mTableNames = array_map( 'trim', explode( ',',
$tablesStr ) );
$sqlQuery->mFieldsStr = $fieldsStr;
$sqlQuery->mOrigWhereStr = $whereStr;
$sqlQuery->mWhereStr = $whereStr;
diff --git a/CargoUtils.php b/CargoUtils.php
index 430617f..9110148 100644
--- a/CargoUtils.php
+++ b/CargoUtils.php
@@ -153,13 +153,13 @@
}
if ( $curChar == $delimiter && $numOpenParentheses == 0
) {
- $returnValues[] = $curReturnValue;
+ $returnValues[] = trim( $curReturnValue );
$curReturnValue = '';
} else {
$curReturnValue .= $curChar;
}
}
- $returnValues[] = $curReturnValue;
+ $returnValues[] = trim( $curReturnValue );
return $returnValues;
}
--
To view, visit https://gerrit.wikimedia.org/r/190810
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia97c00de05faea9289eeb133c55a4ffd0609c90e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits