r49793 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49792‎ | r49793 | r49794 >
Date:03:27, 24 April 2009
Author:werdna
Status:ok
Tags:
Comment:
(bug 18077) PostgreSQL compatibility issues in AbuseFilter, patch contributed by Brad Jorsch
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php (modified) (history)
  • /trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php
@@ -147,10 +147,9 @@
148148
149149 function getQueryInfo() {
150150 $dbr = wfGetDB( DB_SLAVE );
151 - #$this->mConds[] = 'afa_filter=af_id';
152151 $abuse_filter = $dbr->tableName( 'abuse_filter' );
153152 return array(
154 - 'tables' => array('abuse_filter', 'abuse_filter_action'),
 153+ 'tables' => array('abuse_filter'),
155154 'fields' => array(
156155 'af_id',
157156 'af_enabled',
@@ -165,10 +164,6 @@
166165 'af_actions'
167166 ),
168167 'conds' => $this->mConds,
169 - 'options' => array( 'GROUP BY' => 'af_id' ),
170 - 'join_conds' => array(
171 - 'abuse_filter_action' => array( 'LEFT JOIN', 'afa_filter=af_id' )
172 - )
173168 );
174169 }
175170
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php
@@ -159,7 +159,8 @@
160160 // Do the update
161161 $dbw->insert( 'abuse_filter_history', $afh_row, __METHOD__ );
162162 $history_id = $dbw->insertId();
163 - $dbw->delete( 'abuse_filter_action', array( 'afa_filter' => $filter ), __METHOD__ );
 163+ if ($filter != 'new')
 164+ $dbw->delete( 'abuse_filter_action', array( 'afa_filter' => $filter ), __METHOD__ );
164165 $dbw->insert( 'abuse_filter_action', $actionsRows, __METHOD__ );
165166
166167 $dbw->commit();
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php
@@ -226,7 +226,7 @@
227227
228228 // If one of these is true, we're abusefilter compatible.
229229 $compatConds = array(
230 - 'rc_this_oldid',
 230+ 'rc_this_oldid != 0',
231231 'rc_log_action' => array( 'move', 'create' ),
232232 );
233233
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -818,15 +818,19 @@
819819 public static function storeVarDump( $vars, $global = false ) {
820820 wfProfileIn( __METHOD__ );
821821
 822+ global $wgCompressRevisions;
 823+
822824 if ( is_array( $vars ) || is_object( $vars ) )
823825 $text = serialize( $vars );
824826 else $text = $vars;
825827
826828 $flags = array();
827829
828 - if (function_exists( 'gzdeflate' )) {
829 - $text = gzdeflate( $text );
830 - $flags[] = 'gzip';
 830+ if( $wgCompressRevisions ) {
 831+ if (function_exists( 'gzdeflate' )) {
 832+ $text = gzdeflate( $text );
 833+ $flags[] = 'gzip';
 834+ }
831835 }
832836
833837 // Store to ES if applicable

Status & tagging log