mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-18 00:20:37 +00:00
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
This commit is contained in:
parent
ff18e8a06c
commit
8a9fccbcc8
|
@ -151,6 +151,14 @@ class AbuseFilterViewEdit extends AbuseFilterView {
|
|||
$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 ) {
|
||||
|
|
Loading…
Reference in a new issue