mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Use string cast for Postgres compatibility
We JOIN integer and text, so Postgres would always fail on these. As mentioned in the task description, this is only a temporary solution (although a clean and durable one), while the long-term one is I7460a2d63f60c2933b36f8383a8abdbba8649e12. Bug: T42757 Change-Id: Ifddd0bca1e8eaa7c70511fb0d0588457b4fd0669
This commit is contained in:
parent
7a6468fa29
commit
4ab12305f1
|
@ -97,11 +97,12 @@ class ApiQueryAbuseLog extends ApiQueryBase {
|
|||
$this->addFieldsIf( 'afl_actions', $fld_result );
|
||||
$this->addFieldsIf( 'afl_wiki', $fld_wiki );
|
||||
|
||||
$db = $this->getDB();
|
||||
if ( $fld_filter ) {
|
||||
$this->addTables( 'abuse_filter' );
|
||||
$this->addFields( 'af_public_comments' );
|
||||
$this->addJoinConds( [ 'abuse_filter' => [ 'LEFT JOIN',
|
||||
'af_id=afl_filter' ] ] );
|
||||
$db->buildStringCast( 'af_id' ) . '=afl_filter' ] ] );
|
||||
}
|
||||
|
||||
$this->addOption( 'LIMIT', $params['limit'] + 1 );
|
||||
|
|
|
@ -45,7 +45,7 @@ class AbuseLogPager extends ReverseChronologicalPager {
|
|||
[ 'abuse_filter' =>
|
||||
[
|
||||
'LEFT JOIN',
|
||||
'af_id=afl_filter',
|
||||
$this->mDb->buildStringCast( 'af_id' ) . '=afl_filter',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -282,7 +282,7 @@ class SpecialAbuseLog extends SpecialPage {
|
|||
[ 'afl_id' => $id ],
|
||||
__METHOD__,
|
||||
[],
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
|
||||
);
|
||||
|
||||
if ( !$row ) {
|
||||
|
@ -511,7 +511,7 @@ class SpecialAbuseLog extends SpecialPage {
|
|||
[ 'afl_id' => $id ],
|
||||
__METHOD__,
|
||||
[],
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
|
||||
);
|
||||
|
||||
if ( !$row ) {
|
||||
|
@ -649,7 +649,7 @@ class SpecialAbuseLog extends SpecialPage {
|
|||
[ 'afl_id' => $id ],
|
||||
__METHOD__,
|
||||
[],
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', 'af_id=afl_filter' ] ]
|
||||
[ 'abuse_filter' => [ 'LEFT JOIN', $dbr->buildStringCast( 'af_id' ) . '=afl_filter' ] ]
|
||||
);
|
||||
|
||||
if ( !$row ) {
|
||||
|
|
Loading…
Reference in a new issue