[MediaWiki-commits] [Gerrit] More disallowed keywords - change (mediawiki...Cargo)
Yaron Koren has submitted this change and it was merged. Change subject: More disallowed keywords .. More disallowed keywords Change-Id: If2c42bb57a5d1bddd897c8bc19f57b04bb242d12 --- M parserfunctions/CargoDeclare.php 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Yaron Koren: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/parserfunctions/CargoDeclare.php b/parserfunctions/CargoDeclare.php index e391a31..5a056f2 100644 --- a/parserfunctions/CargoDeclare.php +++ b/parserfunctions/CargoDeclare.php @@ -55,8 +55,16 @@ } elseif ( in_array( strtolower( $fieldName ), // Some of these are more likely as // field names than others... - array( 'create', 'table', 'update', 'insert', 'delete', 'select', 'where', 'join', 'on', 'order', 'group', 'by', 'limit', 'having', 'is', 'null', 'and', 'or', 'between', 'merge', 'union', 'intersect', 'except', 'case', 'if' ) ) ) { + array( 'create', 'table', 'update', 'insert', 'delete', 'select', 'where', + 'join', 'on', 'order', 'group', 'by', 'limit', 'having', 'is', + 'like', 'not', 'null', 'and', 'or', 'between', 'merge', + 'union', 'intersect', 'except', 'case', 'if' ) ) ) { return CargoUtils::formatError( "Error: \"$fieldName\" cannot be used as a Cargo field name, because it is an SQL keyword." ); + } elseif ( in_array( strtolower( $fieldName ), + // Similarly, handle the Cargo + // pseudo-SQL keywords. + array( 'holds', 'near' ) ) ) { + return CargoUtils::formatError( "Error: \"$fieldName\" cannot be used as a Cargo field name, because it is already a Cargo keyword." ); } $fieldDescription = CargoFieldDescription::newFromString( $fieldDescriptionStr ); -- To view, visit https://gerrit.wikimedia.org/r/254915 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2c42bb57a5d1bddd897c8bc19f57b04bb242d12 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cargo Gerrit-Branch: master Gerrit-Owner: Yaron Koren Gerrit-Reviewer: Yaron Koren Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] More disallowed keywords - change (mediawiki...Cargo)
Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/254915 Change subject: More disallowed keywords .. More disallowed keywords Change-Id: If2c42bb57a5d1bddd897c8bc19f57b04bb242d12 --- M parserfunctions/CargoDeclare.php 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo refs/changes/15/254915/1 diff --git a/parserfunctions/CargoDeclare.php b/parserfunctions/CargoDeclare.php index e391a31..5a056f2 100644 --- a/parserfunctions/CargoDeclare.php +++ b/parserfunctions/CargoDeclare.php @@ -55,8 +55,16 @@ } elseif ( in_array( strtolower( $fieldName ), // Some of these are more likely as // field names than others... - array( 'create', 'table', 'update', 'insert', 'delete', 'select', 'where', 'join', 'on', 'order', 'group', 'by', 'limit', 'having', 'is', 'null', 'and', 'or', 'between', 'merge', 'union', 'intersect', 'except', 'case', 'if' ) ) ) { + array( 'create', 'table', 'update', 'insert', 'delete', 'select', 'where', + 'join', 'on', 'order', 'group', 'by', 'limit', 'having', 'is', + 'like', 'not', 'null', 'and', 'or', 'between', 'merge', + 'union', 'intersect', 'except', 'case', 'if' ) ) ) { return CargoUtils::formatError( "Error: \"$fieldName\" cannot be used as a Cargo field name, because it is an SQL keyword." ); + } elseif ( in_array( strtolower( $fieldName ), + // Similarly, handle the Cargo + // pseudo-SQL keywords. + array( 'holds', 'near' ) ) ) { + return CargoUtils::formatError( "Error: \"$fieldName\" cannot be used as a Cargo field name, because it is already a Cargo keyword." ); } $fieldDescription = CargoFieldDescription::newFromString( $fieldDescriptionStr ); -- To view, visit https://gerrit.wikimedia.org/r/254915 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2c42bb57a5d1bddd897c8bc19f57b04bb242d12 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cargo Gerrit-Branch: master Gerrit-Owner: Yaron Koren ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits