jenkins-bot has submitted this change and it was merged.

Change subject: Fix for tinyint(1)'s not accepting ''
......................................................................


Fix for tinyint(1)'s not accepting ''

These boolean values go through DatabaseBase::makeList,
which passes them along to DatabaseBase::addQuotes, which
shoves the value through DatabaseMysqlBase::strencode,
which in turn passes it on to DatabaseMysqli::mysqlRealEscapeString,
which eventually calls mysqli::real_escape_string on it.

This last one will turn trues into '1' and falses into ''.
MySQL (or at least my version, 5.6.17 Homebrew) complains about
receiving incorrect integer value '' for these tinyint(1) columns.

Bug: T67807
Change-Id: Iaef98c08589370f9288c1f3c80803b1a16b2506e
---
M Views/AbuseFilterViewEdit.php
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Views/AbuseFilterViewEdit.php b/Views/AbuseFilterViewEdit.php
index 2a2f742..177afca 100755
--- a/Views/AbuseFilterViewEdit.php
+++ b/Views/AbuseFilterViewEdit.php
@@ -151,6 +151,14 @@
                        $newRow['af_throttled'] = $newRow['af_throttled'] && 
!$newRow['af_enabled'];
                        $newRow['af_id'] = $new_id; // ID.
 
+                       // T67807
+                       // integer 1's & 0's might be better understood than 
booleans
+                       $newRow['af_enabled'] = (int) $newRow['af_enabled'];
+                       $newRow['af_hidden'] = (int) $newRow['af_hidden'];
+                       $newRow['af_throttled'] = (int) $newRow['af_throttled'];
+                       $newRow['af_deleted'] = (int) $newRow['af_deleted'];
+                       $newRow['af_global'] = (int) $newRow['af_global'];
+
                        $dbw->replace( 'abuse_filter', array( 'af_id' ), 
$newRow, __METHOD__ );
 
                        if ( $is_new ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/135762
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaef98c08589370f9288c1f3c80803b1a16b2506e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Aklapper <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to