Index: trunk/extensions/AbuseFilter/AbuseFilter.parser.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | class AFPData { |
66 | | - //Datatypes |
| 66 | + // Datatypes |
67 | 67 | const DInt = 'int'; |
68 | 68 | const DString = 'string'; |
69 | 69 | const DNull = 'null'; |
— | — | @@ -79,21 +79,21 @@ |
80 | 80 | } |
81 | 81 | |
82 | 82 | public static function newFromPHPVar( $var ) { |
83 | | - if( is_string( $var ) ) |
| 83 | + if ( is_string( $var ) ) |
84 | 84 | return new AFPData( self::DString, $var ); |
85 | | - elseif( is_int( $var ) ) |
| 85 | + elseif ( is_int( $var ) ) |
86 | 86 | return new AFPData( self::DInt, $var ); |
87 | | - elseif( is_float( $var ) ) |
| 87 | + elseif ( is_float( $var ) ) |
88 | 88 | return new AFPData( self::DFloat, $var ); |
89 | | - elseif( is_bool( $var ) ) |
| 89 | + elseif ( is_bool( $var ) ) |
90 | 90 | return new AFPData( self::DBool, $var ); |
91 | | - elseif( is_array( $var ) ) { |
| 91 | + elseif ( is_array( $var ) ) { |
92 | 92 | $result = array(); |
93 | | - foreach( $var as $item ) |
| 93 | + foreach ( $var as $item ) |
94 | 94 | $result[] = self::newFromPHPVar( $item ); |
95 | 95 | return new AFPData( self::DList, $result ); |
96 | 96 | } |
97 | | - elseif( is_null( $var ) ) |
| 97 | + elseif ( is_null( $var ) ) |
98 | 98 | return new AFPData(); |
99 | 99 | else |
100 | 100 | throw new AFPException( |
— | — | @@ -105,42 +105,42 @@ |
106 | 106 | } |
107 | 107 | |
108 | 108 | public static function castTypes( $orig, $target ) { |
109 | | - if( $orig->type == $target ) |
| 109 | + if ( $orig->type == $target ) |
110 | 110 | return $orig->dup(); |
111 | | - if( $target == self::DNull ) { |
| 111 | + if ( $target == self::DNull ) { |
112 | 112 | return new AFPData(); |
113 | 113 | } |
114 | 114 | |
115 | | - if( $orig->type == self::DList ) { |
116 | | - if( $target == self::DBool ) |
| 115 | + if ( $orig->type == self::DList ) { |
| 116 | + if ( $target == self::DBool ) |
117 | 117 | return new AFPData( self::DBool, (bool)count( $orig->data ) ); |
118 | | - if( $target == self::DFloat ) { |
| 118 | + if ( $target == self::DFloat ) { |
119 | 119 | return new AFPData( self::DFloat, doubleval( count( $orig->data ) ) ); |
120 | 120 | } |
121 | | - if( $target == self::DInt ) { |
| 121 | + if ( $target == self::DInt ) { |
122 | 122 | return new AFPData( self::DInt, intval( count( $orig->data ) ) ); |
123 | 123 | } |
124 | | - if( $target == self::DString ) { |
| 124 | + if ( $target == self::DString ) { |
125 | 125 | $s = ''; |
126 | | - foreach( $orig->data as $item ) |
| 126 | + foreach ( $orig->data as $item ) |
127 | 127 | $s .= $item->toString() . "\n"; |
128 | 128 | return new AFPData( self::DString, $s ); |
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
132 | | - if( $target == self::DBool ) { |
| 132 | + if ( $target == self::DBool ) { |
133 | 133 | return new AFPData( self::DBool, (bool)$orig->data ); |
134 | 134 | } |
135 | | - if( $target == self::DFloat ) { |
| 135 | + if ( $target == self::DFloat ) { |
136 | 136 | return new AFPData( self::DFloat, doubleval( $orig->data ) ); |
137 | 137 | } |
138 | | - if( $target == self::DInt ) { |
| 138 | + if ( $target == self::DInt ) { |
139 | 139 | return new AFPData( self::DInt, intval( $orig->data ) ); |
140 | 140 | } |
141 | | - if( $target == self::DString ) { |
| 141 | + if ( $target == self::DString ) { |
142 | 142 | return new AFPData( self::DString, strval( $orig->data ) ); |
143 | 143 | } |
144 | | - if( $target == self::DList ) { |
| 144 | + if ( $target == self::DList ) { |
145 | 145 | return new AFPData( self::DList, array( $orig ) ); |
146 | 146 | } |
147 | 147 | } |
— | — | @@ -177,8 +177,8 @@ |
178 | 178 | |
179 | 179 | public static function listContains( $value, $list ) { |
180 | 180 | // Should use built-in PHP function somehow |
181 | | - foreach( $list->data as $item ) { |
182 | | - if( self::equals( $value, $item ) ) |
| 181 | + foreach ( $list->data as $item ) { |
| 182 | + if ( self::equals( $value, $item ) ) |
183 | 183 | return true; |
184 | 184 | } |
185 | 185 | return false; |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | set_error_handler( array( 'AbuseFilterParser', 'regexErrorHandler' ) ); |
211 | 211 | $result = preg_match( $pattern, $str ); |
212 | 212 | restore_error_handler(); |
213 | | - } catch( Exception $e ) { |
| 213 | + } catch ( Exception $e ) { |
214 | 214 | restore_error_handler(); |
215 | 215 | throw $e; |
216 | 216 | } |
— | — | @@ -218,47 +218,47 @@ |
219 | 219 | |
220 | 220 | public static function unaryMinus( $data ) { |
221 | 221 | if ( $data->type == self::DInt ) { |
222 | | - return new AFPData( $data->type, -$data->toInt() ); |
| 222 | + return new AFPData( $data->type, - $data->toInt() ); |
223 | 223 | } else { |
224 | | - return new AFPData( $data->type, -$data->toFloat() ); |
| 224 | + return new AFPData( $data->type, - $data->toFloat() ); |
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | 228 | public static function boolOp( $a, $b, $op ) { |
229 | 229 | $a = $a->toBool(); |
230 | 230 | $b = $b->toBool(); |
231 | | - if( $op == '|' ) |
| 231 | + if ( $op == '|' ) |
232 | 232 | return new AFPData( self::DBool, $a || $b ); |
233 | | - if( $op == '&' ) |
| 233 | + if ( $op == '&' ) |
234 | 234 | return new AFPData( self::DBool, $a && $b ); |
235 | | - if( $op == '^' ) |
| 235 | + if ( $op == '^' ) |
236 | 236 | return new AFPData( self::DBool, $a xor $b ); |
237 | 237 | throw new AFPException( "Invalid boolean operation: {$op}" ); // Should never happen. |
238 | 238 | } |
239 | 239 | |
240 | 240 | public static function compareOp( $a, $b, $op ) { |
241 | | - if( $op == '==' || $op == '=' ) |
| 241 | + if ( $op == '==' || $op == '=' ) |
242 | 242 | return new AFPData( self::DBool, self::equals( $a, $b ) ); |
243 | | - if( $op == '!=' ) |
| 243 | + if ( $op == '!=' ) |
244 | 244 | return new AFPData( self::DBool, !self::equals( $a, $b ) ); |
245 | | - if( $op == '===' ) |
| 245 | + if ( $op == '===' ) |
246 | 246 | return new AFPData( self::DBool, $a->type == $b->type && self::equals( $a, $b ) ); |
247 | | - if( $op == '!==' ) |
| 247 | + if ( $op == '!==' ) |
248 | 248 | return new AFPData( self::DBool, $a->type != $b->type || !self::equals( $a, $b ) ); |
249 | 249 | $a = $a->toString(); |
250 | 250 | $b = $b->toString(); |
251 | | - if( $op == '>' ) |
| 251 | + if ( $op == '>' ) |
252 | 252 | return new AFPData( self::DBool, $a > $b ); |
253 | | - if( $op == '<' ) |
| 253 | + if ( $op == '<' ) |
254 | 254 | return new AFPData( self::DBool, $a < $b ); |
255 | | - if( $op == '>=' ) |
| 255 | + if ( $op == '>=' ) |
256 | 256 | return new AFPData( self::DBool, $a >= $b ); |
257 | | - if( $op == '<=' ) |
| 257 | + if ( $op == '<=' ) |
258 | 258 | return new AFPData( self::DBool, $a <= $b ); |
259 | 259 | throw new AFPException( "Invalid comparison operation: {$op}" ); // Should never happen |
260 | 260 | } |
261 | 261 | |
262 | | - public static function mulRel( $a, $b, $op, $pos ) { |
| 262 | + public static function mulRel( $a, $b, $op, $pos ) { |
263 | 263 | // Figure out the type. |
264 | 264 | if ( $a->type == self::DFloat || $b->type == self::DFloat || |
265 | 265 | $a->toFloat() != $a->toString() || $b->toFloat() != $b->toString() ) { |
— | — | @@ -276,11 +276,11 @@ |
277 | 277 | } |
278 | 278 | |
279 | 279 | $data = null; |
280 | | - if( $op == '*' ) |
| 280 | + if ( $op == '*' ) |
281 | 281 | $data = $a * $b; |
282 | | - elseif( $op == '/' ) |
| 282 | + elseif ( $op == '/' ) |
283 | 283 | $data = $a / $b; |
284 | | - elseif( $op == '%' ) |
| 284 | + elseif ( $op == '%' ) |
285 | 285 | $data = $a % $b; |
286 | 286 | else |
287 | 287 | throw new AFPException( "Invalid multiplication-related operation: {$op}" ); // Should never happen |
— | — | @@ -294,9 +294,9 @@ |
295 | 295 | } |
296 | 296 | |
297 | 297 | public static function sum( $a, $b ) { |
298 | | - if( $a->type == self::DString || $b->type == self::DString ) |
| 298 | + if ( $a->type == self::DString || $b->type == self::DString ) |
299 | 299 | return new AFPData( self::DString, $a->toString() . $b->toString() ); |
300 | | - elseif( $a->type == self::DList && $b->type == self::DList ) |
| 300 | + elseif ( $a->type == self::DList && $b->type == self::DList ) |
301 | 301 | return new AFPData( self::DList, array_merge( $a->toList(), $b->toList() ) ); |
302 | 302 | else |
303 | 303 | return new AFPData( self::DFloat, $a->toFloat() + $b->toFloat() ); |
— | — | @@ -318,7 +318,7 @@ |
319 | 319 | public function toFloat() { |
320 | 320 | return self::castTypes( $this, self::DFloat )->data; |
321 | 321 | } |
322 | | - |
| 322 | + |
323 | 323 | public function toInt() { |
324 | 324 | return self::castTypes( $this, self::DInt )->data; |
325 | 325 | } |
— | — | @@ -338,7 +338,7 @@ |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | | -class AFPException extends MWException {} |
| 342 | +class AFPException extends MWException { } |
343 | 343 | |
344 | 344 | // Exceptions that we might conceivably want to report to ordinary users |
345 | 345 | // (i.e. exceptions that don't represent bugs in the extension itself) |
— | — | @@ -397,7 +397,7 @@ |
398 | 398 | '&', '|', '^', // Logic |
399 | 399 | ':=', // Setting |
400 | 400 | '?', ':', // Ternery |
401 | | - '<=','<', // Less than |
| 401 | + '<=', '<', // Less than |
402 | 402 | '>=', '>', // Greater than |
403 | 403 | '===', '==', '=', // Equality |
404 | 404 | ); |
— | — | @@ -446,7 +446,7 @@ |
447 | 447 | |
448 | 448 | public function setVars( $vars ) { |
449 | 449 | if ( is_array( $vars ) ) { |
450 | | - foreach( $vars as $name => $var ) { |
| 450 | + foreach ( $vars as $name => $var ) { |
451 | 451 | $this->setVar( $name, $var ); |
452 | 452 | } |
453 | 453 | } elseif ( $vars instanceof AbuseFilterVariableHolder ) { |
— | — | @@ -477,24 +477,24 @@ |
478 | 478 | } |
479 | 479 | |
480 | 480 | protected function skipOverBraces() { |
481 | | - if( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == '(' ) || !$this->mShortCircuit ) { |
| 481 | + if ( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == '(' ) || !$this->mShortCircuit ) { |
482 | 482 | return; |
483 | 483 | } |
484 | 484 | |
485 | 485 | $braces = 1; |
486 | 486 | wfProfileIn( __METHOD__ ); |
487 | | - while( $this->mCur->type != AFPToken::TNone && $braces > 0 ) { |
| 487 | + while ( $this->mCur->type != AFPToken::TNone && $braces > 0 ) { |
488 | 488 | $this->move(); |
489 | | - if( $this->mCur->type == AFPToken::TBrace ) { |
490 | | - if( $this->mCur->value == '(' ) { |
| 489 | + if ( $this->mCur->type == AFPToken::TBrace ) { |
| 490 | + if ( $this->mCur->value == '(' ) { |
491 | 491 | $braces++; |
492 | | - } elseif( $this->mCur->value == ')' ) { |
| 492 | + } elseif ( $this->mCur->value == ')' ) { |
493 | 493 | $braces--; |
494 | 494 | } |
495 | 495 | } |
496 | 496 | } |
497 | 497 | wfProfileOut( __METHOD__ ); |
498 | | - if( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == ')' ) ) |
| 498 | + if ( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == ')' ) ) |
499 | 499 | throw new AFPUserVisibleException( 'expectednotfound', $this->mCur->pos, array( ')' ) ); |
500 | 500 | } |
501 | 501 | |
— | — | @@ -523,7 +523,7 @@ |
524 | 524 | return 0; |
525 | 525 | } |
526 | 526 | |
527 | | - return ( strlen( $a ) < strlen( $b ) ) ? -1 : 1; |
| 527 | + return ( strlen( $a ) < strlen( $b ) ) ? - 1 : 1; |
528 | 528 | } |
529 | 529 | |
530 | 530 | /* Levels */ |
— | — | @@ -532,45 +532,45 @@ |
533 | 533 | protected function doLevelEntry( &$result ) { |
534 | 534 | $this->doLevelSemicolon( $result ); |
535 | 535 | |
536 | | - if( $this->mCur->type != AFPToken::TNone ) { |
| 536 | + if ( $this->mCur->type != AFPToken::TNone ) { |
537 | 537 | throw new AFPUserVisibleException( 'unexpectedatend', $this->mCur->pos, array( $this->mCur->type ) ); |
538 | 538 | } |
539 | 539 | } |
540 | | - |
| 540 | + |
541 | 541 | /** Handles multiple expressions */ |
542 | 542 | protected function doLevelSemicolon( &$result ) { |
543 | 543 | do { |
544 | 544 | $this->move(); |
545 | | - if( $this->mCur->type != AFPToken::TStatementSeparator ) |
| 545 | + if ( $this->mCur->type != AFPToken::TStatementSeparator ) |
546 | 546 | $this->doLevelSet( $result ); |
547 | | - } while( $this->mCur->type == AFPToken::TStatementSeparator ); |
| 547 | + } while ( $this->mCur->type == AFPToken::TStatementSeparator ); |
548 | 548 | } |
549 | 549 | |
550 | 550 | /** Handles multiple expressions */ |
551 | 551 | protected function doLevelSet( &$result ) { |
552 | | - if( $this->mCur->type == AFPToken::TID ) { |
| 552 | + if ( $this->mCur->type == AFPToken::TID ) { |
553 | 553 | $varname = $this->mCur->value; |
554 | 554 | $prev = $this->getState(); |
555 | 555 | $this->move(); |
556 | 556 | |
557 | | - if( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':=' ) { |
| 557 | + if ( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':=' ) { |
558 | 558 | $this->move(); |
559 | 559 | $this->doLevelSet( $result ); |
560 | 560 | $this->setUserVariable( $varname, $result ); |
561 | 561 | return; |
562 | | - } elseif( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == '[' ) { |
563 | | - if( !$this->mVars->varIsSet( $varname ) ) { |
| 562 | + } elseif ( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == '[' ) { |
| 563 | + if ( !$this->mVars->varIsSet( $varname ) ) { |
564 | 564 | throw new AFPUserVisibleException( 'unrecognisedvar', |
565 | 565 | $this->mCur->pos, |
566 | 566 | array( $var ) |
567 | 567 | ); |
568 | 568 | } |
569 | 569 | $list = $this->mVars->getVar( $varname ); |
570 | | - if( $list->type != AFPData::DList ) |
| 570 | + if ( $list->type != AFPData::DList ) |
571 | 571 | throw new AFPUserVisibleException( 'notlist', $this->mCur->pos, array() ); |
572 | 572 | $list = $list->toList(); |
573 | 573 | $this->move(); |
574 | | - if( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) { |
| 574 | + if ( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) { |
575 | 575 | $idx = 'new'; |
576 | 576 | } else { |
577 | 577 | $this->setState( $prev ); |
— | — | @@ -578,19 +578,19 @@ |
579 | 579 | $idx = new AFPData(); |
580 | 580 | $this->doLevelSemicolon( $idx ); |
581 | 581 | $idx = $idx->toInt(); |
582 | | - if( !( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) ) |
583 | | - throw new AFPUserVisibleException( 'expectednotfound', $this->mCur->pos, |
584 | | - array(']', $this->mCur->type, $this->mCur->value ) ); |
585 | | - if( count( $list ) <= $idx ) { |
| 582 | + if ( !( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) ) |
| 583 | + throw new AFPUserVisibleException( 'expectednotfound', $this->mCur->pos, |
| 584 | + array( ']', $this->mCur->type, $this->mCur->value ) ); |
| 585 | + if ( count( $list ) <= $idx ) { |
586 | 586 | throw new AFPUserVisibleException( 'outofbounds', $this->mCur->pos, |
587 | 587 | array( $idx, count( $result->data ) ) ); |
588 | 588 | } |
589 | 589 | } |
590 | 590 | $this->move(); |
591 | | - if( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':=' ) { |
| 591 | + if ( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':=' ) { |
592 | 592 | $this->move(); |
593 | 593 | $this->doLevelSet( $result ); |
594 | | - if( $idx === 'new' ) |
| 594 | + if ( $idx === 'new' ) |
595 | 595 | $list[] = $result; |
596 | 596 | else |
597 | 597 | $list[$idx] = $result; |
— | — | @@ -607,11 +607,11 @@ |
608 | 608 | } |
609 | 609 | |
610 | 610 | protected function doLevelConditions( &$result ) { |
611 | | - if( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'if' ) { |
| 611 | + if ( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'if' ) { |
612 | 612 | $this->move(); |
613 | 613 | $this->doLevelBoolOps( $result ); |
614 | 614 | |
615 | | - if( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'then' ) ) |
| 615 | + if ( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'then' ) ) |
616 | 616 | throw new AFPUserVisibleException( 'expectednotfound', |
617 | 617 | $this->mCur->pos, |
618 | 618 | array( |
— | — | @@ -636,7 +636,7 @@ |
637 | 637 | $this->mShortCircuit = $scOrig; |
638 | 638 | } |
639 | 639 | |
640 | | - if( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'else' ) ) |
| 640 | + if ( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'else' ) ) |
641 | 641 | throw new AFPUserVisibleException( 'expectednotfound', |
642 | 642 | $this->mCur->pos, |
643 | 643 | array( |
— | — | @@ -656,7 +656,7 @@ |
657 | 657 | $this->mShortCircuit = $scOrig; |
658 | 658 | } |
659 | 659 | |
660 | | - if( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'end' ) ) |
| 660 | + if ( !( $this->mCur->type == AFPToken::TKeyword && $this->mCur->value == 'end' ) ) |
661 | 661 | throw new AFPUserVisibleException( 'expectednotfound', |
662 | 662 | $this->mCur->pos, |
663 | 663 | array( |
— | — | @@ -667,7 +667,7 @@ |
668 | 668 | ); |
669 | 669 | $this->move(); |
670 | 670 | |
671 | | - if( $result->toBool() ) { |
| 671 | + if ( $result->toBool() ) { |
672 | 672 | $result = $r1; |
673 | 673 | } else { |
674 | 674 | $result = $r2; |
— | — | @@ -675,7 +675,7 @@ |
676 | 676 | |
677 | 677 | } else { |
678 | 678 | $this->doLevelBoolOps( $result ); |
679 | | - if( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '?' ) { |
| 679 | + if ( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '?' ) { |
680 | 680 | $this->move(); |
681 | 681 | $r1 = new AFPData(); |
682 | 682 | $r2 = new AFPData(); |
— | — | @@ -691,7 +691,7 @@ |
692 | 692 | $this->mShortCircuit = $scOrig; |
693 | 693 | } |
694 | 694 | |
695 | | - if( !( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':' ) ) |
| 695 | + if ( !( $this->mCur->type == AFPToken::TOp && $this->mCur->value == ':' ) ) |
696 | 696 | throw new AFPUserVisibleException( 'expectednotfound', |
697 | 697 | $this->mCur->pos, |
698 | 698 | array( |
— | — | @@ -711,7 +711,7 @@ |
712 | 712 | $this->mShortCircuit = $scOrig; |
713 | 713 | } |
714 | 714 | |
715 | | - if( $isTrue ) { |
| 715 | + if ( $isTrue ) { |
716 | 716 | $result = $r1; |
717 | 717 | } else { |
718 | 718 | $result = $r2; |
— | — | @@ -723,7 +723,7 @@ |
724 | 724 | protected function doLevelBoolOps( &$result ) { |
725 | 725 | $this->doLevelCompares( $result ); |
726 | 726 | $ops = array( '&', '|', '^' ); |
727 | | - while( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
| 727 | + while ( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
728 | 728 | $op = $this->mCur->value; |
729 | 729 | $this->move(); |
730 | 730 | $r2 = new AFPData(); |
— | — | @@ -762,7 +762,7 @@ |
763 | 763 | AbuseFilter::triggerLimiter(); |
764 | 764 | $this->doLevelSumRels( $result ); |
765 | 765 | $ops = array( '==', '===', '!=', '!==', '<', '>', '<=', '>=', '=' ); |
766 | | - while( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
| 766 | + while ( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
767 | 767 | $op = $this->mCur->value; |
768 | 768 | $this->move(); |
769 | 769 | $r2 = new AFPData(); |
— | — | @@ -777,14 +777,14 @@ |
778 | 778 | $this->doLevelMulRels( $result ); |
779 | 779 | wfProfileIn( __METHOD__ ); |
780 | 780 | $ops = array( '+', '-' ); |
781 | | - while( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
| 781 | + while ( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
782 | 782 | $op = $this->mCur->value; |
783 | 783 | $this->move(); |
784 | 784 | $r2 = new AFPData(); |
785 | 785 | $this->doLevelMulRels( $r2 ); |
786 | | - if( $op == '+' ) |
| 786 | + if ( $op == '+' ) |
787 | 787 | $result = AFPData::sum( $result, $r2 ); |
788 | | - if( $op == '-' ) |
| 788 | + if ( $op == '-' ) |
789 | 789 | $result = AFPData::sub( $result, $r2 ); |
790 | 790 | } |
791 | 791 | wfProfileOut( __METHOD__ ); |
— | — | @@ -794,7 +794,7 @@ |
795 | 795 | $this->doLevelPow( $result ); |
796 | 796 | wfProfileIn( __METHOD__ ); |
797 | 797 | $ops = array( '*', '/', '%' ); |
798 | | - while( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
| 798 | + while ( $this->mCur->type == AFPToken::TOp && in_array( $this->mCur->value, $ops ) ) { |
799 | 799 | $op = $this->mCur->value; |
800 | 800 | $this->move(); |
801 | 801 | $r2 = new AFPData(); |
— | — | @@ -807,7 +807,7 @@ |
808 | 808 | protected function doLevelPow( &$result ) { |
809 | 809 | $this->doLevelBoolInvert( $result ); |
810 | 810 | wfProfileIn( __METHOD__ ); |
811 | | - while( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '**' ) { |
| 811 | + while ( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '**' ) { |
812 | 812 | $this->move(); |
813 | 813 | $expanent = new AFPData(); |
814 | 814 | $this->doLevelBoolInvert( $expanent ); |
— | — | @@ -817,7 +817,7 @@ |
818 | 818 | } |
819 | 819 | |
820 | 820 | protected function doLevelBoolInvert( &$result ) { |
821 | | - if( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '!' ) { |
| 821 | + if ( $this->mCur->type == AFPToken::TOp && $this->mCur->value == '!' ) { |
822 | 822 | $this->move(); |
823 | 823 | $this->doLevelSpecialWords( $result ); |
824 | 824 | wfProfileIn( __METHOD__ ); |
— | — | @@ -839,7 +839,7 @@ |
840 | 840 | 'rlike' => 'keywordRegex', |
841 | 841 | 'regex' => 'keywordRegex' |
842 | 842 | ); |
843 | | - if( $this->mCur->type == AFPToken::TKeyword && in_array( $keyword, array_keys( $specwords ) ) ) { |
| 843 | + if ( $this->mCur->type == AFPToken::TKeyword && in_array( $keyword, array_keys( $specwords ) ) ) { |
844 | 844 | $func = $specwords[$keyword]; |
845 | 845 | $this->move(); |
846 | 846 | $r2 = new AFPData(); |
— | — | @@ -860,11 +860,11 @@ |
861 | 861 | |
862 | 862 | protected function doLevelUnarys( &$result ) { |
863 | 863 | $op = $this->mCur->value; |
864 | | - if( $this->mCur->type == AFPToken::TOp && ( $op == "+" || $op == "-" ) ) { |
| 864 | + if ( $this->mCur->type == AFPToken::TOp && ( $op == "+" || $op == "-" ) ) { |
865 | 865 | $this->move(); |
866 | 866 | $this->doLevelListElements( $result ); |
867 | 867 | wfProfileIn( __METHOD__ ); |
868 | | - if( $op == '-' ) { |
| 868 | + if ( $op == '-' ) { |
869 | 869 | $result = AFPData::unaryMinus( $result ); |
870 | 870 | } |
871 | 871 | wfProfileOut( __METHOD__ ); |
— | — | @@ -875,16 +875,16 @@ |
876 | 876 | |
877 | 877 | protected function doLevelListElements( &$result ) { |
878 | 878 | $this->doLevelBraces( $result ); |
879 | | - while( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == '[' ) { |
| 879 | + while ( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == '[' ) { |
880 | 880 | $idx = new AFPData(); |
881 | 881 | $this->doLevelSemicolon( $idx ); |
882 | | - if( !( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) ) { |
| 882 | + if ( !( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) ) { |
883 | 883 | throw new AFPUserVisibleException( 'expectednotfound', $this->mCur->pos, |
884 | | - array(']', $this->mCur->type, $this->mCur->value ) ); |
| 884 | + array( ']', $this->mCur->type, $this->mCur->value ) ); |
885 | 885 | } |
886 | 886 | $idx = $idx->toInt(); |
887 | | - if( $result->type == AFPData::DList ) { |
888 | | - if( count( $result->data ) <= $idx ) { |
| 887 | + if ( $result->type == AFPData::DList ) { |
| 888 | + if ( count( $result->data ) <= $idx ) { |
889 | 889 | throw new AFPUserVisibleException( 'outofbounds', $this->mCur->pos, |
890 | 890 | array( $idx, count( $result->data ) ) ); |
891 | 891 | } |
— | — | @@ -897,16 +897,16 @@ |
898 | 898 | } |
899 | 899 | |
900 | 900 | protected function doLevelBraces( &$result ) { |
901 | | - if( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == '(' ) { |
902 | | - if( $this->mShortCircuit ) { |
| 901 | + if ( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == '(' ) { |
| 902 | + if ( $this->mShortCircuit ) { |
903 | 903 | $this->skipOverBraces(); |
904 | 904 | } else { |
905 | 905 | $this->doLevelSemicolon( $result ); |
906 | 906 | } |
907 | | - if( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == ')' ) ) |
| 907 | + if ( !( $this->mCur->type == AFPToken::TBrace && $this->mCur->value == ')' ) ) |
908 | 908 | throw new AFPUserVisibleException( 'expectednotfound', |
909 | 909 | $this->mCur->pos, |
910 | | - array(')', $this->mCur->type, $this->mCur->value ) ); |
| 910 | + array( ')', $this->mCur->type, $this->mCur->value ) ); |
911 | 911 | $this->move(); |
912 | 912 | } else { |
913 | 913 | $this->doLevelFunction( $result ); |
— | — | @@ -914,11 +914,11 @@ |
915 | 915 | } |
916 | 916 | |
917 | 917 | protected function doLevelFunction( &$result ) { |
918 | | - if( $this->mCur->type == AFPToken::TID && isset( self::$mFunctions[$this->mCur->value] ) ) { |
| 918 | + if ( $this->mCur->type == AFPToken::TID && isset( self::$mFunctions[$this->mCur->value] ) ) { |
919 | 919 | wfProfileIn( __METHOD__ ); |
920 | 920 | $func = self::$mFunctions[$this->mCur->value]; |
921 | 921 | $this->move(); |
922 | | - if( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != '(' ) |
| 922 | + if ( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != '(' ) |
923 | 923 | throw new AFPUserVisibleException( 'expectednotfound', |
924 | 924 | $this->mCur->pos, |
925 | 925 | array( |
— | — | @@ -941,9 +941,9 @@ |
942 | 942 | $r = new AFPData(); |
943 | 943 | $this->doLevelSemicolon( $r ); |
944 | 944 | $args[] = $r; |
945 | | - } while( $this->mCur->type == AFPToken::TComma ); |
| 945 | + } while ( $this->mCur->type == AFPToken::TComma ); |
946 | 946 | |
947 | | - if( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != ')' ) { |
| 947 | + if ( $this->mCur->type != AFPToken::TBrace || $this->mCur->value != ')' ) { |
948 | 948 | throw new AFPUserVisibleException( 'expectednotfound', |
949 | 949 | $this->mCur->pos, |
950 | 950 | array( |
— | — | @@ -1000,11 +1000,11 @@ |
1001 | 1001 | $result = new AFPData( AFPData::DInt, $tok ); |
1002 | 1002 | break; |
1003 | 1003 | case AFPToken::TKeyword: |
1004 | | - if( $tok == "true" ) |
| 1004 | + if ( $tok == "true" ) |
1005 | 1005 | $result = new AFPData( AFPData::DBool, true ); |
1006 | | - elseif( $tok == "false" ) |
| 1006 | + elseif ( $tok == "false" ) |
1007 | 1007 | $result = new AFPData( AFPData::DBool, false ); |
1008 | | - elseif( $tok == "null" ) |
| 1008 | + elseif ( $tok == "null" ) |
1009 | 1009 | $result = new AFPData(); |
1010 | 1010 | else |
1011 | 1011 | throw new AFPUserVisibleException( |
— | — | @@ -1016,24 +1016,24 @@ |
1017 | 1017 | case AFPToken::TNone: |
1018 | 1018 | return; // Handled at entry level |
1019 | 1019 | case AFPToken::TBrace: |
1020 | | - if( $this->mCur->value == ')' ) |
| 1020 | + if ( $this->mCur->value == ')' ) |
1021 | 1021 | return; // Handled at the entry level |
1022 | 1022 | case AFPToken::TSquareBracket: |
1023 | | - if( $this->mCur->value == '[' ) { |
| 1023 | + if ( $this->mCur->value == '[' ) { |
1024 | 1024 | $list = array(); |
1025 | | - for(;;) { |
| 1025 | + for ( ; ; ) { |
1026 | 1026 | $this->move(); |
1027 | | - if( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) |
| 1027 | + if ( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) |
1028 | 1028 | break; |
1029 | 1029 | $item = new AFPData(); |
1030 | 1030 | $this->doLevelSet( $item ); |
1031 | 1031 | $list[] = $item; |
1032 | | - if( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) |
| 1032 | + if ( $this->mCur->type == AFPToken::TSquareBracket && $this->mCur->value == ']' ) |
1033 | 1033 | break; |
1034 | | - if( $this->mCur->type != AFPToken::TComma ) |
| 1034 | + if ( $this->mCur->type != AFPToken::TComma ) |
1035 | 1035 | throw new AFPUserVisibleException( 'expectednotfound', |
1036 | 1036 | $this->mCur->pos, |
1037 | | - array(', or ]', $this->mCur->type, $this->mCur->value ) ); |
| 1037 | + array( ', or ]', $this->mCur->type, $this->mCur->value ) ); |
1038 | 1038 | } |
1039 | 1039 | $result = new AFPData( AFPData::DList, $list ); |
1040 | 1040 | break; |
— | — | @@ -1056,7 +1056,7 @@ |
1057 | 1057 | |
1058 | 1058 | protected function getVarValue( $var ) { |
1059 | 1059 | wfProfileIn( __METHOD__ ); |
1060 | | - $var = strtolower($var); |
| 1060 | + $var = strtolower( $var ); |
1061 | 1061 | $builderValues = AbuseFilter::getBuilderValues(); |
1062 | 1062 | if ( !( array_key_exists( $var, $builderValues['vars'] ) |
1063 | 1063 | || $this->mVars->varIsSet( $var ) ) ) { |
— | — | @@ -1076,7 +1076,7 @@ |
1077 | 1077 | |
1078 | 1078 | protected function setUserVariable( $name, $value ) { |
1079 | 1079 | $builderValues = AbuseFilter::getBuilderValues(); |
1080 | | - if( array_key_exists( $name, $builderValues['vars'] ) ) |
| 1080 | + if ( array_key_exists( $name, $builderValues['vars'] ) ) |
1081 | 1081 | throw new AFPUserVisibleException( 'overridebuiltin', $this->mCur->pos, array( $name ) ); |
1082 | 1082 | $this->mVars->setVar( $name, $value ); |
1083 | 1083 | } |
— | — | @@ -1095,11 +1095,11 @@ |
1096 | 1096 | // Spaces |
1097 | 1097 | $matches = array(); |
1098 | 1098 | if ( preg_match( '/\s+/uA', $code, $matches, 0, $offset ) ) { |
1099 | | - $offset += strlen( $matches[0] ); |
| 1099 | + $offset += strlen( $matches[0] ); |
1100 | 1100 | } |
1101 | | - |
1102 | | - if( $offset >= strlen( $code ) ) return array( '', AFPToken::TNone, $code, $offset ); |
1103 | 1101 | |
| 1102 | + if ( $offset >= strlen( $code ) ) return array( '', AFPToken::TNone, $code, $offset ); |
| 1103 | + |
1104 | 1104 | // Comments |
1105 | 1105 | if ( substr( $code, $offset, 2 ) == '/*' ) { |
1106 | 1106 | $end = strpos( $code, '*/', $offset ); |
— | — | @@ -1108,17 +1108,17 @@ |
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | // Commas |
1112 | | - if( $code[$offset] == ',' ) { |
| 1112 | + if ( $code[$offset] == ',' ) { |
1113 | 1113 | return array( ',', AFPToken::TComma, $code, $offset + 1 ); |
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | // Braces |
1117 | | - if( $code[$offset] == '(' or $code[$offset] == ')' ) { |
| 1117 | + if ( $code[$offset] == '(' or $code[$offset] == ')' ) { |
1118 | 1118 | return array( $code[$offset], AFPToken::TBrace, $code, $offset + 1 ); |
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | // Square brackets |
1122 | | - if( $code[$offset] == '[' or $code[$offset] == ']' ) { |
| 1122 | + if ( $code[$offset] == '[' or $code[$offset] == ']' ) { |
1123 | 1123 | return array( $code[$offset], AFPToken::TSquareBracket, $code, $offset + 1 ); |
1124 | 1124 | } |
1125 | 1125 | |
— | — | @@ -1128,13 +1128,13 @@ |
1129 | 1129 | } |
1130 | 1130 | |
1131 | 1131 | // Strings |
1132 | | - if( $code[$offset] == '"' || $code[$offset] == "'" ) { |
| 1132 | + if ( $code[$offset] == '"' || $code[$offset] == "'" ) { |
1133 | 1133 | $type = $code[$offset]; |
1134 | 1134 | $offset++; |
1135 | 1135 | $strLen = strlen( $code ); |
1136 | | - while( $offset < $strLen ) { |
| 1136 | + while ( $offset < $strLen ) { |
1137 | 1137 | |
1138 | | - if( $code[$offset] == $type ) { |
| 1138 | + if ( $code[$offset] == $type ) { |
1139 | 1139 | $offset++; |
1140 | 1140 | return array( $tok, AFPToken::TString, $code, $offset ); |
1141 | 1141 | } |
— | — | @@ -1145,7 +1145,7 @@ |
1146 | 1146 | if ( $addLength ) { |
1147 | 1147 | $tok .= substr( $code, $offset, $addLength ); |
1148 | 1148 | $offset += $addLength; |
1149 | | - } elseif( $code[$offset] == '\\' ) { |
| 1149 | + } elseif ( $code[$offset] == '\\' ) { |
1150 | 1150 | switch( $code[$offset + 1] ) { |
1151 | 1151 | case '\\': |
1152 | 1152 | $tok .= '\\'; |
— | — | @@ -1177,14 +1177,14 @@ |
1178 | 1178 | $tok .= "\\" . $code[$offset + 1]; |
1179 | 1179 | } |
1180 | 1180 | |
1181 | | - $offset+=2; |
| 1181 | + $offset += 2; |
1182 | 1182 | |
1183 | 1183 | } else { |
1184 | 1184 | $tok .= $code[$offset]; |
1185 | 1185 | $offset++; |
1186 | 1186 | } |
1187 | 1187 | } |
1188 | | - throw new AFPUserVisibleException( 'unclosedstring', $offset, array() );; |
| 1188 | + throw new AFPUserVisibleException( 'unclosedstring', $offset, array() ); ; |
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | // Find operators |
— | — | @@ -1194,7 +1194,7 @@ |
1195 | 1195 | if ( !$operator_regex ) { |
1196 | 1196 | $quoted_operators = array(); |
1197 | 1197 | |
1198 | | - foreach( self::$mOps as $op ) |
| 1198 | + foreach ( self::$mOps as $op ) |
1199 | 1199 | $quoted_operators[] = preg_quote( $op, '/' ); |
1200 | 1200 | $operator_regex = '/(' . implode( '|', $quoted_operators ) . ')/A'; |
1201 | 1201 | } |
— | — | @@ -1203,7 +1203,7 @@ |
1204 | 1204 | |
1205 | 1205 | preg_match( $operator_regex, $code, $matches, 0, $offset ); |
1206 | 1206 | |
1207 | | - if( count( $matches ) ) { |
| 1207 | + if ( count( $matches ) ) { |
1208 | 1208 | $tok = $matches[0]; |
1209 | 1209 | $offset += strlen( $tok ); |
1210 | 1210 | return array( $tok, AFPToken::TOp, $code, $offset ); |
— | — | @@ -1232,9 +1232,9 @@ |
1233 | 1233 | // Sometimes the base char gets mixed in with the rest of it because |
1234 | 1234 | // the regex targets hex, too. |
1235 | 1235 | // This mostly happens with binary |
1236 | | - if ( !$baseChar && !empty( $bases[ substr( $input, -1 ) ] ) ) { |
1237 | | - $baseChar = substr( $input, -1, 1 ); |
1238 | | - $input = substr( $input, 0, -1 ); |
| 1236 | + if ( !$baseChar && !empty( $bases[ substr( $input, - 1 ) ] ) ) { |
| 1237 | + $baseChar = substr( $input, - 1, 1 ); |
| 1238 | + $input = substr( $input, 0, - 1 ); |
1239 | 1239 | } |
1240 | 1240 | |
1241 | 1241 | if ( $baseChar ) { |
— | — | @@ -1293,7 +1293,7 @@ |
1294 | 1294 | // Built-in functions |
1295 | 1295 | protected function funcLc( $args ) { |
1296 | 1296 | global $wgContLang; |
1297 | | - if( count( $args ) < 1 ) |
| 1297 | + if ( count( $args ) < 1 ) |
1298 | 1298 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1299 | 1299 | array( 'lc', 2, count( $args ) ) ); |
1300 | 1300 | $s = $args[0]->toString(); |
— | — | @@ -1301,7 +1301,7 @@ |
1302 | 1302 | } |
1303 | 1303 | |
1304 | 1304 | protected function funcLen( $args ) { |
1305 | | - if( count( $args ) < 1 ) |
| 1305 | + if ( count( $args ) < 1 ) |
1306 | 1306 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1307 | 1307 | array( 'len', 2, count( $args ) ) ); |
1308 | 1308 | |
— | — | @@ -1310,7 +1310,7 @@ |
1311 | 1311 | } |
1312 | 1312 | |
1313 | 1313 | protected function funcSimpleNorm( $args ) { |
1314 | | - if( count( $args ) < 1 ) |
| 1314 | + if ( count( $args ) < 1 ) |
1315 | 1315 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1316 | 1316 | array( 'simplenorm', 2, count( $args ) ) ); |
1317 | 1317 | $s = $args[0]->toString(); |
— | — | @@ -1321,7 +1321,7 @@ |
1322 | 1322 | } |
1323 | 1323 | |
1324 | 1324 | protected function funcSpecialRatio( $args ) { |
1325 | | - if( count( $args ) < 1 ) |
| 1325 | + if ( count( $args ) < 1 ) |
1326 | 1326 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1327 | 1327 | array( 'specialratio', 1, count( $args ) ) ); |
1328 | 1328 | $s = $args[0]->toString(); |
— | — | @@ -1338,17 +1338,17 @@ |
1339 | 1339 | } |
1340 | 1340 | |
1341 | 1341 | protected function funcCount( $args ) { |
1342 | | - if( count( $args ) < 1 ) |
| 1342 | + if ( count( $args ) < 1 ) |
1343 | 1343 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1344 | 1344 | array( 'count', 1, count( $args ) ) ); |
1345 | 1345 | |
1346 | | - if( $args[0]->type == AFPData::DList && count( $args ) == 1 ) { |
| 1346 | + if ( $args[0]->type == AFPData::DList && count( $args ) == 1 ) { |
1347 | 1347 | return new AFPData( AFPData::DInt, count( $args[0]->data ) ); |
1348 | 1348 | } |
1349 | 1349 | |
1350 | | - $offset = -1; |
| 1350 | + $offset = - 1; |
1351 | 1351 | |
1352 | | - if ( count( $args ) == 1) { |
| 1352 | + if ( count( $args ) == 1 ) { |
1353 | 1353 | $count = count( explode( ",", $args[0]->toString() ) ); |
1354 | 1354 | } else { |
1355 | 1355 | $needle = $args[0]->toString(); |
— | — | @@ -1364,20 +1364,20 @@ |
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | protected function funcRCount( $args ) { |
1368 | | - if( count( $args ) < 1 ) |
| 1368 | + if ( count( $args ) < 1 ) |
1369 | 1369 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1370 | 1370 | array( 'rcount', 1, count( $args ) ) ); |
1371 | 1371 | |
1372 | | - $offset = -1; |
| 1372 | + $offset = - 1; |
1373 | 1373 | |
1374 | | - if ( count( $args ) == 1) { |
| 1374 | + if ( count( $args ) == 1 ) { |
1375 | 1375 | $count = count( explode( ",", $args[0]->toString() ) ); |
1376 | 1376 | } else { |
1377 | 1377 | $needle = $regex = $args[0]->toString(); |
1378 | 1378 | $haystack = $args[1]->toString(); |
1379 | 1379 | $pos = $this->mCur->pos; |
1380 | 1380 | |
1381 | | - ## Munge the regex |
| 1381 | + # # Munge the regex |
1382 | 1382 | $needle = preg_replace( '!(\\\\\\\\)*(\\\\)?/!', '$1\/', $needle ); |
1383 | 1383 | $needle = "/$needle/u"; |
1384 | 1384 | |
— | — | @@ -1388,7 +1388,7 @@ |
1389 | 1389 | set_error_handler( array( 'AbuseFilterParser', 'regexErrorHandler' ) ); |
1390 | 1390 | $count = preg_match_all( $needle, $haystack, $matches ); |
1391 | 1391 | restore_error_handler(); |
1392 | | - } catch( Exception $e ) { |
| 1392 | + } catch ( Exception $e ) { |
1393 | 1393 | restore_error_handler(); |
1394 | 1394 | throw $e; |
1395 | 1395 | } |
— | — | @@ -1398,7 +1398,7 @@ |
1399 | 1399 | } |
1400 | 1400 | |
1401 | 1401 | protected function funcIPInRange( $args ) { |
1402 | | - if( count( $args ) < 2 ) |
| 1402 | + if ( count( $args ) < 2 ) |
1403 | 1403 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1404 | 1404 | array( 'ip_in_range', 2, count( $args ) ) ); |
1405 | 1405 | |
— | — | @@ -1411,7 +1411,7 @@ |
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | protected function funcCCNorm( $args ) { |
1415 | | - if( count( $args ) < 1 ) |
| 1415 | + if ( count( $args ) < 1 ) |
1416 | 1416 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1417 | 1417 | array( 'ccnorm', 1, count( $args ) ) ); |
1418 | 1418 | $s = $args[0]->toString(); |
— | — | @@ -1433,7 +1433,7 @@ |
1434 | 1434 | |
1435 | 1435 | $searchStrings = array(); |
1436 | 1436 | |
1437 | | - foreach( $args as $arg ) { |
| 1437 | + foreach ( $args as $arg ) { |
1438 | 1438 | $searchStrings[] = $arg->toString(); |
1439 | 1439 | } |
1440 | 1440 | |
— | — | @@ -1444,8 +1444,8 @@ |
1445 | 1445 | $ok = is_array( $result ); |
1446 | 1446 | } else { |
1447 | 1447 | $ok = false; |
1448 | | - foreach( $searchStrings as $needle ) { |
1449 | | - if( in_string( $needle, $s ) ) { |
| 1448 | + foreach ( $searchStrings as $needle ) { |
| 1449 | + if ( in_string( $needle, $s ) ) { |
1450 | 1450 | $ok = true; |
1451 | 1451 | break; |
1452 | 1452 | } |
— | — | @@ -1466,12 +1466,12 @@ |
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | return $replacementArray->replace( $s ); |
1470 | | - } |
| 1470 | + } |
1471 | 1471 | |
1472 | 1472 | protected function rmspecials( $s ) { |
1473 | 1473 | $orig = $s; |
1474 | 1474 | $s = preg_replace( '/[^\p{L}\p{N}]/u', '', $s ); |
1475 | | - |
| 1475 | + |
1476 | 1476 | return $s; |
1477 | 1477 | } |
1478 | 1478 | |
— | — | @@ -1484,18 +1484,18 @@ |
1485 | 1485 | } |
1486 | 1486 | |
1487 | 1487 | protected function funcRMSpecials( $args ) { |
1488 | | - if( count( $args ) < 1 ) |
| 1488 | + if ( count( $args ) < 1 ) |
1489 | 1489 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1490 | 1490 | array( 'rmspecials', 1, count( $args ) ) ); |
1491 | 1491 | $s = $args[0]->toString(); |
1492 | | - |
| 1492 | + |
1493 | 1493 | $s = $this->rmspecials( $s ); |
1494 | | - |
| 1494 | + |
1495 | 1495 | return new AFPData( AFPData::DString, $s ); |
1496 | 1496 | } |
1497 | | - |
| 1497 | + |
1498 | 1498 | protected function funcRMWhitespace( $args ) { |
1499 | | - if( count( $args ) < 1 ) |
| 1499 | + if ( count( $args ) < 1 ) |
1500 | 1500 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1501 | 1501 | array( 'rmwhitespace', 1, count( $args ) ) ); |
1502 | 1502 | $s = $args[0]->toString(); |
— | — | @@ -1506,7 +1506,7 @@ |
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | protected function funcRMDoubles( $args ) { |
1510 | | - if( count( $args ) < 1 ) |
| 1510 | + if ( count( $args ) < 1 ) |
1511 | 1511 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1512 | 1512 | array( 'rmdoubles', 1, count( $args ) ) ); |
1513 | 1513 | $s = $args[0]->toString(); |
— | — | @@ -1517,7 +1517,7 @@ |
1518 | 1518 | } |
1519 | 1519 | |
1520 | 1520 | protected function funcNorm( $args ) { |
1521 | | - if( count( $args ) < 1 ) |
| 1521 | + if ( count( $args ) < 1 ) |
1522 | 1522 | throw new AFPUserVisibleException( 'notenoughargs', $this->mCur->pos, |
1523 | 1523 | array( 'norm', 1, count( $args ) ) ); |
1524 | 1524 | $s = $args[0]->toString(); |
— | — | @@ -1568,7 +1568,7 @@ |
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | if ( $result === false ) |
1572 | | - $result = -1; |
| 1572 | + $result = - 1; |
1573 | 1573 | |
1574 | 1574 | return new AFPData( AFPData::DInt, $result ); |
1575 | 1575 | } |
— | — | @@ -1641,10 +1641,10 @@ |
1642 | 1642 | } |
1643 | 1643 | } |
1644 | 1644 | |
1645 | | - ## Taken from http://au2.php.net/manual/en/function.fnmatch.php#71725 |
1646 | | - ### Attribution: jk at ricochetsolutions dot com |
| 1645 | + # Taken from http://au2.php.net/manual/en/function.fnmatch.php#71725 |
| 1646 | + # Attribution: jk at ricochetsolutions dot com |
1647 | 1647 | |
1648 | | -if( !function_exists( 'fnmatch' ) ) { |
| 1648 | +if ( !function_exists( 'fnmatch' ) ) { |
1649 | 1649 | |
1650 | 1650 | function fnmatch( $pattern, $string ) { |
1651 | 1651 | return preg_match( "#^" . strtr( preg_quote( $pattern, '#' ), array( '\*' => '.*', '\?' => '.' ) ) . "$#iu", $string ); |
Index: trunk/extensions/AbuseFilter/SpecialAbuseLog.php |
— | — | @@ -3,7 +3,6 @@ |
4 | 4 | die(); |
5 | 5 | |
6 | 6 | class SpecialAbuseLog extends SpecialPage { |
7 | | - |
8 | 7 | public function __construct() { |
9 | 8 | wfLoadExtensionMessages( 'AbuseFilter' ); |
10 | 9 | parent::__construct( 'AbuseLog', 'abusefilter-log' ); |
— | — | @@ -24,11 +23,11 @@ |
25 | 24 | $wgOut->enableClientCache( false ); |
26 | 25 | |
27 | 26 | global $wgScriptPath; |
28 | | - $wgOut->addExtensionStyle( $wgScriptPath . |
| 27 | + $wgOut->addExtensionStyle( $wgScriptPath . |
29 | 28 | "/extensions/AbuseFilter/abusefilter.css?$wgAbuseFilterStyleVersion" ); |
30 | 29 | |
31 | 30 | // Are we allowed? |
32 | | - $errors = $this->getTitle()->getUserPermissionsErrors( |
| 31 | + $errors = $this->getTitle()->getUserPermissionsErrors( |
33 | 32 | 'abusefilter-log', $wgUser, true, array( 'ns-specialprotected' ) ); |
34 | 33 | if ( count( $errors ) ) { |
35 | 34 | // Go away. |
— | — | @@ -74,20 +73,20 @@ |
75 | 74 | $fields = array(); |
76 | 75 | |
77 | 76 | // Search conditions |
78 | | - $fields['abusefilter-log-search-user'] = |
| 77 | + $fields['abusefilter-log-search-user'] = |
79 | 78 | Xml::input( 'wpSearchUser', 45, $this->mSearchUser ); |
80 | 79 | if ( $this->canSeeDetails() ) { |
81 | | - $fields['abusefilter-log-search-filter'] = |
| 80 | + $fields['abusefilter-log-search-filter'] = |
82 | 81 | Xml::input( 'wpSearchFilter', 45, $this->mSearchFilter ); |
83 | 82 | } |
84 | | - $fields['abusefilter-log-search-title'] = |
| 83 | + $fields['abusefilter-log-search-title'] = |
85 | 84 | Xml::input( 'wpSearchTitle', 45, $this->mSearchTitle ); |
86 | 85 | |
87 | 86 | $form = Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ); |
88 | 87 | |
89 | 88 | $form .= Xml::buildForm( $fields, 'abusefilter-log-search-submit' ); |
90 | 89 | $output .= Xml::tags( 'form', |
91 | | - array( 'method' => 'GET', 'action' => $this->getTitle()->getLocalURL() ), |
| 90 | + array( 'method' => 'GET', 'action' => $this->getTitle()->getLocalURL() ), |
92 | 91 | $form ); |
93 | 92 | $output = Xml::tags( 'fieldset', null, $output ); |
94 | 93 | |
— | — | @@ -141,7 +140,7 @@ |
142 | 141 | $output .= Xml::element( 'legend', null, wfMsg( 'abusefilter-log-details-legend', $id ) ); |
143 | 142 | $output .= Xml::tags( 'p', null, $this->formatRow( $row, false ) ); |
144 | 143 | |
145 | | - // Load data |
| 144 | + // Load data |
146 | 145 | $vars = AbuseFilter::loadVarDump( $row->afl_var_dump ); |
147 | 146 | |
148 | 147 | // Diff, if available |
— | — | @@ -228,7 +227,7 @@ |
229 | 228 | function formatRow( $row, $li = true ) { |
230 | 229 | global $wgLang, $wgUser; |
231 | 230 | |
232 | | - ## One-time setup |
| 231 | + # # One-time setup |
233 | 232 | static $sk = null; |
234 | 233 | |
235 | 234 | if ( is_null( $sk ) ) { |
— | — | @@ -263,7 +262,7 @@ |
264 | 263 | $actions = explode( ',', $actions_taken ); |
265 | 264 | $displayActions = array(); |
266 | 265 | |
267 | | - foreach( $actions as $action ) { |
| 266 | + foreach ( $actions as $action ) { |
268 | 267 | $displayActions[] = AbuseFilter::getActionDisplay( $action ); |
269 | 268 | } |
270 | 269 | $actions_taken = implode( ', ', $displayActions ); |
— | — | @@ -283,9 +282,9 @@ |
284 | 283 | if ( $this->canSeeDetails() ) { |
285 | 284 | $examineTitle = SpecialPage::getTitleFor( 'AbuseFilter', 'examine/log/' . $row->afl_id ); |
286 | 285 | $detailsLink = $sk->makeKnownLinkObj( |
287 | | - $this->getTitle(), |
288 | | - wfMsg( 'abusefilter-log-detailslink' ), |
289 | | - 'details='.$row->afl_id |
| 286 | + $this->getTitle(), |
| 287 | + wfMsg( 'abusefilter-log-detailslink' ), |
| 288 | + 'details=' . $row->afl_id |
290 | 289 | ); |
291 | 290 | $examineLink = $sk->link( |
292 | 291 | $examineTitle, |
— | — | @@ -334,13 +333,12 @@ |
335 | 334 | $sk->link( $title ), |
336 | 335 | $actions_taken, |
337 | 336 | $parsed_comments |
338 | | - ) |
| 337 | + ) |
339 | 338 | ); |
340 | 339 | } |
341 | 340 | |
342 | 341 | return $li ? Xml::tags( 'li', null, $description ) : $description; |
343 | 342 | } |
344 | | - |
345 | 343 | } |
346 | 344 | |
347 | 345 | class AbuseLogPager extends ReverseChronologicalPager { |
Index: trunk/extensions/AbuseFilter/install.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Makes the required changes for the AbuseFilter extension |
6 | 5 | */ |
Index: trunk/extensions/AbuseFilter/SpecialAbuseFilter.php |
— | — | @@ -3,7 +3,6 @@ |
4 | 4 | die(); |
5 | 5 | |
6 | 6 | class SpecialAbuseFilter extends SpecialPage { |
7 | | - |
8 | 7 | var $mSkin; |
9 | 8 | |
10 | 9 | public function __construct() { |
— | — | @@ -14,7 +13,7 @@ |
15 | 14 | public function execute( $subpage ) { |
16 | 15 | global $wgUser, $wgOut, $wgRequest, $wgAbuseFilterStyleVersion, $wgScriptPath; |
17 | 16 | |
18 | | - $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/AbuseFilter/abusefilter.css?" . |
| 17 | + $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/AbuseFilter/abusefilter.css?" . |
19 | 18 | $wgAbuseFilterStyleVersion ); |
20 | 19 | $view = 'AbuseFilterViewList'; |
21 | 20 | |
— | — | @@ -32,7 +31,7 @@ |
33 | 32 | if ( $wgRequest->getVal( 'result' ) == 'success' ) { |
34 | 33 | $wgOut->setSubtitle( wfMsg( 'abusefilter-edit-done-subtitle' ) ); |
35 | 34 | $changedFilter = intval( $wgRequest->getVal( 'changedfilter' ) ); |
36 | | - $wgOut->wrapWikiMsg( '<p class="success">$1</p>', |
| 35 | + $wgOut->wrapWikiMsg( '<p class="success">$1</p>', |
37 | 36 | array( 'abusefilter-edit-done', $changedFilter ) ); |
38 | 37 | } |
39 | 38 | |
— | — | @@ -43,7 +42,7 @@ |
44 | 43 | $params = explode( '/', $subpage ); |
45 | 44 | |
46 | 45 | // Filter by removing blanks. |
47 | | - foreach( $params as $index => $param ) { |
| 46 | + foreach ( $params as $index => $param ) { |
48 | 47 | if ( $param === '' ) { |
49 | 48 | unset( $params[$index] ); |
50 | 49 | } |
— | — | @@ -77,7 +76,7 @@ |
78 | 77 | $view = 'AbuseFilterViewHistory'; |
79 | 78 | $pageType = 'recentchanges'; |
80 | 79 | } elseif ( count( $params ) == 2 ) { |
81 | | - ## Second param is a filter ID |
| 80 | + # # Second param is a filter ID |
82 | 81 | $view = 'AbuseFilterViewHistory'; |
83 | 82 | $this->mFilter = $params[1]; |
84 | 83 | } elseif ( count( $params ) == 4 && $params[2] == 'item' ) { |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
— | — | @@ -20,7 +19,7 @@ |
21 | 20 | $links['abusefilter-diff-backhistory'] = $this->getTitle( 'history/' . $this->mFilter ); |
22 | 21 | } |
23 | 22 | |
24 | | - foreach( $links as $msg => $title ) { |
| 23 | + foreach ( $links as $msg => $title ) { |
25 | 24 | $links[$msg] = $this->mSkin->link( $title, wfMsgExt( $msg, 'parseinline' ) ); |
26 | 25 | } |
27 | 26 | |
— | — | @@ -81,7 +80,7 @@ |
82 | 81 | } elseif ( $spec == 'prev' && !in_array( $otherSpec, $dependentSpecs ) ) { |
83 | 82 | // cached |
84 | 83 | $other = $this->loadSpec( $otherSpec, $spec ); |
85 | | - |
| 84 | + |
86 | 85 | $row = $dbr->selectRow( |
87 | 86 | 'abuse_filter_history', |
88 | 87 | '*', |
— | — | @@ -116,7 +115,7 @@ |
117 | 116 | ); |
118 | 117 | |
119 | 118 | if ( $other && !$row ) { |
120 | | - $t = $this->getTitle( |
| 119 | + $t = $this->getTitle( |
121 | 120 | 'history/' . $this->mFilter . '/item/' . $other['meta']['history_id'] ); |
122 | 121 | global $wgOut; |
123 | 122 | $wgOut->redirect( $t->getFullURL() ); |
— | — | @@ -152,6 +151,7 @@ |
153 | 152 | |
154 | 153 | function formatVersionLink( $timestamp, $history_id ) { |
155 | 154 | global $wgLang, $wgUser; |
| 155 | + |
156 | 156 | $sk = $wgUser->getSkin(); |
157 | 157 | |
158 | 158 | $filter = $this->mFilter; |
— | — | @@ -261,7 +261,7 @@ |
262 | 262 | $lines = array(); |
263 | 263 | |
264 | 264 | ksort( $actions ); |
265 | | - foreach( $actions as $action => $parameters ) { |
| 265 | + foreach ( $actions as $action => $parameters ) { |
266 | 266 | $lines[] = AbuseFilter::formatAction( $action, $parameters ); |
267 | 267 | } |
268 | 268 | |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | return $html; |
281 | 281 | } |
282 | 282 | |
283 | | - function getSimpleRow( $msg, $old, $new, $format='wikitext' ) { |
| 283 | + function getSimpleRow( $msg, $old, $new, $format = 'wikitext' ) { |
284 | 284 | $row = ''; |
285 | 285 | |
286 | 286 | $row .= Xml::tags( 'th', null, wfMsgExt( $msg, 'parseinline' ) ); |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewImport.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | class AbuseFilterViewImport extends AbuseFilterView { |
5 | 4 | |
6 | 5 | function show() { |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewList.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
— | — | @@ -28,10 +27,10 @@ |
29 | 28 | $deleted = $wgRequest->getVal( 'deletedfilters' ); |
30 | 29 | $hidedisabled = $wgRequest->getBool( 'hidedisabled' ); |
31 | 30 | if ( $deleted == 'show' ) { |
32 | | - ## Nothing |
| 31 | + # Nothing |
33 | 32 | } elseif ( $deleted == 'only' ) { |
34 | 33 | $conds['af_deleted'] = 1; |
35 | | - } else { ## hide, or anything else. |
| 34 | + } else { # hide, or anything else. |
36 | 35 | $conds['af_deleted'] = 0; |
37 | 36 | $deleted = 'hide'; |
38 | 37 | } |
— | — | @@ -56,7 +55,7 @@ |
57 | 56 | |
58 | 57 | extract( $optarray ); |
59 | 58 | |
60 | | - ## Options form |
| 59 | + # Options form |
61 | 60 | $options = ''; |
62 | 61 | $fields = array(); |
63 | 62 | $fields['abusefilter-list-options-deleted'] = |
— | — | @@ -74,7 +73,7 @@ |
75 | 74 | 'mw-abusefilter-deletedfilters-hide', |
76 | 75 | $deleted == 'hide' |
77 | 76 | ) . |
78 | | - Xml::radioLabel( |
| 77 | + Xml::radioLabel( |
79 | 78 | wfMsg( 'abusefilter-list-options-deleted-only' ), |
80 | 79 | 'deletedfilters', |
81 | 80 | 'only', |
— | — | @@ -139,7 +138,6 @@ |
140 | 139 | |
141 | 140 | // Probably no need to autoload this class, as it will only be called from the class above. |
142 | 141 | class AbuseFilterPager extends TablePager { |
143 | | - |
144 | 142 | function __construct( $page, $conds ) { |
145 | 143 | $this->mPage = $page; |
146 | 144 | $this->mConds = $conds; |
— | — | @@ -191,7 +189,7 @@ |
192 | 190 | } |
193 | 191 | |
194 | 192 | function formatValue( $name, $value ) { |
195 | | - global $wgOut,$wgLang; |
| 193 | + global $wgOut, $wgLang; |
196 | 194 | |
197 | 195 | static $sk = null; |
198 | 196 | |
— | — | @@ -204,18 +202,18 @@ |
205 | 203 | |
206 | 204 | switch( $name ) { |
207 | 205 | case 'af_id': |
208 | | - return $sk->link( |
| 206 | + return $sk->link( |
209 | 207 | SpecialPage::getTitleFor( 'AbuseFilter', intval( $value ) ), intval( $value ) ); |
210 | 208 | case 'af_public_comments': |
211 | | - return $sk->link( |
212 | | - SpecialPage::getTitleFor( 'AbuseFilter', intval( $row->af_id ) ), |
213 | | - $wgOut->parseInline( $value ) |
| 209 | + return $sk->link( |
| 210 | + SpecialPage::getTitleFor( 'AbuseFilter', intval( $row->af_id ) ), |
| 211 | + $wgOut->parseInline( $value ) |
214 | 212 | ); |
215 | 213 | case 'af_actions': |
216 | 214 | $actions = explode( ',', $value ); |
217 | 215 | $displayActions = array(); |
218 | | - foreach( $actions as $action ) { |
219 | | - $displayActions[] = AbuseFilter::getActionDisplay( $action );; |
| 216 | + foreach ( $actions as $action ) { |
| 217 | + $displayActions[] = AbuseFilter::getActionDisplay( $action ); ; |
220 | 218 | } |
221 | 219 | return htmlspecialchars( implode( ', ', $displayActions ) ); |
222 | 220 | case 'af_enabled': |
— | — | @@ -253,7 +251,7 @@ |
254 | 252 | $row->af_user, |
255 | 253 | $row->af_user_text |
256 | 254 | ) . |
257 | | - $sk->userToolLinks( |
| 255 | + $sk->userToolLinks( |
258 | 256 | $row->af_user, |
259 | 257 | $row->af_user_text |
260 | 258 | ); |
— | — | @@ -265,7 +263,7 @@ |
266 | 264 | $userLink, |
267 | 265 | $wgLang->date( $value, true ), |
268 | 266 | $wgLang->time( $value, true ), |
269 | | - $user ) |
| 267 | + $user ) |
270 | 268 | ); |
271 | 269 | default: |
272 | 270 | throw new MWException( "Unknown row type $name!" ); |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterView.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
— | — | @@ -48,9 +47,9 @@ |
49 | 48 | |
50 | 49 | $s .= " ($examineLink)"; |
51 | 50 | |
52 | | - ## If we have a match.. |
| 51 | + # If we have a match.. |
53 | 52 | if ( isset( $rc->filterResult ) ) { |
54 | | - $class = $rc->filterResult ? |
| 53 | + $class = $rc->filterResult ? |
55 | 54 | 'mw-abusefilter-changeslist-match' : |
56 | 55 | 'mw-abusefilter-changeslist-nomatch'; |
57 | 56 | |
— | — | @@ -59,5 +58,5 @@ |
60 | 59 | } |
61 | 60 | |
62 | 61 | // Kill rollback links. |
63 | | - public function insertRollback( &$s, &$rc ) {} |
| 62 | + public function insertRollback( &$s, &$rc ) { } |
64 | 63 | } |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewTools.php |
— | — | @@ -1,11 +1,10 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
7 | 6 | class AbuseFilterViewTools extends AbuseFilterView { |
8 | 7 | function show() { |
9 | | - global $wgRequest,$wgOut,$wgUser; |
| 8 | + global $wgRequest, $wgOut, $wgUser; |
10 | 9 | |
11 | 10 | // Header |
12 | 11 | $wgOut->setSubTitle( wfMsg( 'abusefilter-tools-subtitle' ) ); |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php |
— | — | @@ -1,10 +1,8 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
7 | 6 | class AbuseFilterViewHistory extends AbuseFilterView { |
8 | | - |
9 | 7 | function __construct( $page, $params ) { |
10 | 8 | parent::__construct( $page, $params ); |
11 | 9 | $this->mFilter = $page->mFilter; |
— | — | @@ -20,7 +18,7 @@ |
21 | 19 | else |
22 | 20 | $wgOut->setPageTitle( wfMsg( 'abusefilter-filter-log' ) ); |
23 | 21 | |
24 | | - ## Check perms |
| 22 | + # Check perms |
25 | 23 | if ( $filter && |
26 | 24 | !$wgUser->isAllowed( 'abusefilter-modify' ) && |
27 | 25 | AbuseFilter::filterHidden( $filter ) ) { |
— | — | @@ -28,20 +26,20 @@ |
29 | 27 | return; |
30 | 28 | } |
31 | 29 | |
32 | | - ## Useful links |
| 30 | + # Useful links |
33 | 31 | $sk = $wgUser->getSkin(); |
34 | 32 | $links = array(); |
35 | 33 | if ( $filter ) |
36 | 34 | $links['abusefilter-history-backedit'] = $this->getTitle( $filter ); |
37 | 35 | |
38 | | - foreach( $links as $msg => $title ) { |
| 36 | + foreach ( $links as $msg => $title ) { |
39 | 37 | $links[$msg] = $sk->link( $title, wfMsgExt( $msg, 'parseinline' ) ); |
40 | 38 | } |
41 | 39 | |
42 | 40 | $backlinks = $wgLang->pipeList( $links ); |
43 | 41 | $wgOut->addHTML( Xml::tags( 'p', null, $backlinks ) ); |
44 | 42 | |
45 | | - ## For user |
| 43 | + # For user |
46 | 44 | $user = $wgRequest->getText( 'user' ); |
47 | 45 | if ( $user ) { |
48 | 46 | $wgOut->setSubtitle( |
— | — | @@ -49,7 +47,7 @@ |
50 | 48 | 'abusefilter-history-foruser', |
51 | 49 | $sk->userLink( 1 /* We don't really need to get a user ID */, $user ), |
52 | 50 | $user // For GENDER |
53 | | - ) |
| 51 | + ) |
54 | 52 | ); |
55 | 53 | } |
56 | 54 | |
— | — | @@ -76,7 +74,6 @@ |
77 | 75 | } |
78 | 76 | |
79 | 77 | class AbuseFilterHistoryPager extends TablePager { |
80 | | - |
81 | 78 | function __construct( $filter, $page, $user ) { |
82 | 79 | $this->mFilter = $filter; |
83 | 80 | $this->mPage = $page; |
— | — | @@ -92,7 +89,7 @@ |
93 | 90 | return $headers; |
94 | 91 | } |
95 | 92 | |
96 | | - $headers = array( |
| 93 | + $headers = array( |
97 | 94 | 'afh_timestamp' => 'abusefilter-history-timestamp', |
98 | 95 | 'afh_user_text' => 'abusefilter-history-user', |
99 | 96 | 'afh_public_comments' => 'abusefilter-history-public', |
— | — | @@ -128,7 +125,7 @@ |
129 | 126 | |
130 | 127 | switch( $name ) { |
131 | 128 | case 'afh_timestamp': |
132 | | - $title = SpecialPage::getTitleFor( 'AbuseFilter', |
| 129 | + $title = SpecialPage::getTitleFor( 'AbuseFilter', |
133 | 130 | 'history/' . $row->afh_filter . '/item/' . $row->afh_id ); |
134 | 131 | $formatted = $sk->link( $title, $wgLang->timeanddate( $row->afh_timestamp, true ) ); |
135 | 132 | break; |
— | — | @@ -148,7 +145,7 @@ |
149 | 146 | |
150 | 147 | $display_actions = ''; |
151 | 148 | |
152 | | - foreach( $actions as $action => $parameters ) { |
| 149 | + foreach ( $actions as $action => $parameters ) { |
153 | 150 | $displayAction = AbuseFilter::formatAction( $action, $parameters ); |
154 | 151 | $display_actions .= Xml::tags( 'li', null, $displayAction ); |
155 | 152 | } |
— | — | @@ -161,7 +158,7 @@ |
162 | 159 | $formatted = $sk->link( $title, $value ); |
163 | 160 | break; |
164 | 161 | case 'afh_id': |
165 | | - $title = $this->mPage->getTitle( |
| 162 | + $title = $this->mPage->getTitle( |
166 | 163 | 'history/' . $row->afh_filter . "/diff/prev/$value" ); |
167 | 164 | $formatted = $sk->link( $title, wfMsgExt( 'abusefilter-history-diff', 'parseinline' ) ); |
168 | 165 | break; |
— | — | @@ -170,13 +167,13 @@ |
171 | 168 | break; |
172 | 169 | } |
173 | 170 | |
174 | | - $mappings = array_flip( AbuseFilter::$history_mappings ) + |
| 171 | + $mappings = array_flip( AbuseFilter::$history_mappings ) + |
175 | 172 | array( 'afh_actions' => 'actions', 'afh_id' => 'id' ); |
176 | 173 | $changed = explode( ',', $row->afh_changed_fields ); |
177 | 174 | |
178 | 175 | $fieldChanged = false; |
179 | 176 | if ( $name == 'afh_flags' ) { |
180 | | - // This is a bit freaky, but it works. |
| 177 | + // This is a bit freaky, but it works. |
181 | 178 | // Basically, returns true if any of those filters are in the $changed array. |
182 | 179 | $filters = array( 'af_enabled', 'af_hidden', 'af_deleted', 'af_global' ); |
183 | 180 | if ( count( array_diff( $filters, $changed ) ) < count( $filters ) ) { |
— | — | @@ -225,7 +222,7 @@ |
226 | 223 | ); |
227 | 224 | |
228 | 225 | global $wgRequest, $wgUser; |
229 | | - |
| 226 | + |
230 | 227 | if ( $this->mUser ) { |
231 | 228 | $info['conds']['afh_user_text'] = $this->mUser; |
232 | 229 | } |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewTestBatch.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
— | — | @@ -24,14 +23,14 @@ |
25 | 24 | |
26 | 25 | $output = ''; |
27 | 26 | $output .= AbuseFilter::buildEditBox( $this->mFilter, 'wpTestFilter' ) . "\n"; |
28 | | - $output .= |
| 27 | + $output .= |
29 | 28 | Xml::inputLabel( |
30 | 29 | wfMsg( 'abusefilter-test-load-filter' ), |
31 | 30 | 'wpInsertFilter', |
32 | 31 | 'mw-abusefilter-load-filter', |
33 | 32 | 10, |
34 | 33 | '' |
35 | | - ) . |
| 34 | + ) . |
36 | 35 | ' ' . |
37 | 36 | Xml::element( |
38 | 37 | 'input', |
— | — | @@ -39,7 +38,7 @@ |
40 | 39 | 'type' => 'button', |
41 | 40 | 'value' => wfMsg( 'abusefilter-test-load' ), |
42 | 41 | 'id' => 'mw-abusefilter-load' |
43 | | - ) |
| 42 | + ) |
44 | 43 | ); |
45 | 44 | $output = Xml::tags( 'div', array( 'id' => 'mw-abusefilter-test-editor' ), $output ); |
46 | 45 | |
— | — | @@ -48,9 +47,9 @@ |
49 | 48 | // Selectory stuff |
50 | 49 | $selectFields = array(); |
51 | 50 | $selectFields['abusefilter-test-user'] = Xml::input( 'wpTestUser', 45, $this->mTestUser ); |
52 | | - $selectFields['abusefilter-test-period-start'] = |
| 51 | + $selectFields['abusefilter-test-period-start'] = |
53 | 52 | Xml::input( 'wpTestPeriodStart', 45, $this->mTestPeriodStart ); |
54 | | - $selectFields['abusefilter-test-period-end'] = |
| 53 | + $selectFields['abusefilter-test-period-end'] = |
55 | 54 | Xml::input( 'wpTestPeriodEnd', 45, $this->mTestPeriodEnd ); |
56 | 55 | $selectFields['abusefilter-test-page'] = |
57 | 56 | Xml::input( 'wpTestPage', 45, $this->mTestPage ); |
— | — | @@ -59,10 +58,10 @@ |
60 | 59 | |
61 | 60 | $output .= Xml::hidden( 'title', $this->getTitle( 'test' )->getPrefixedText() ); |
62 | 61 | $output = Xml::tags( 'form', |
63 | | - array( |
64 | | - 'action' => $this->getTitle( 'test' )->getLocalURL(), |
| 62 | + array( |
| 63 | + 'action' => $this->getTitle( 'test' )->getLocalURL(), |
65 | 64 | 'method' => 'POST' |
66 | | - ), |
| 65 | + ), |
67 | 66 | $output |
68 | 67 | ); |
69 | 68 | |
— | — | @@ -108,7 +107,7 @@ |
109 | 108 | 'recentchanges', |
110 | 109 | '*', |
111 | 110 | array_filter( $conds ), |
112 | | - __METHOD__, |
| 111 | + __METHOD__, |
113 | 112 | array( 'LIMIT' => self::$mChangeLimit, 'ORDER BY' => 'rc_timestamp desc' ) |
114 | 113 | ); |
115 | 114 | |
— | — | @@ -153,8 +152,8 @@ |
154 | 153 | { |
155 | 154 | $dbr = wfGetDB( DB_SLAVE ); |
156 | 155 | $this->mFilter = $dbr->selectField( 'abuse_filter', |
157 | | - 'af_pattern', |
158 | | - array( 'af_id' => $this->mParams[1] ), |
| 156 | + 'af_pattern', |
| 157 | + array( 'af_id' => $this->mParams[1] ), |
159 | 158 | __METHOD__ |
160 | 159 | ); |
161 | 160 | } |
— | — | @@ -162,13 +161,12 @@ |
163 | 162 | // Normalise username |
164 | 163 | $userTitle = Title::newFromText( $testUsername ); |
165 | 164 | |
166 | | - if ( $userTitle && $userTitle->getNamespace() == NS_USER ) |
| 165 | + if ( $userTitle && $userTitle->getNamespace() == NS_USER ) |
167 | 166 | $this->mTestUser = $userTitle->getText(); // Allow User:Blah syntax. |
168 | 167 | elseif ( $userTitle ) |
169 | 168 | // Not sure of the value of prefixedText over text, but no need to munge unnecessarily. |
170 | 169 | $this->mTestUser = $userTitle->getPrefixedText(); |
171 | 170 | else |
172 | 171 | $this->mTestUser = null; // No user specified. |
173 | | - |
174 | 172 | } |
175 | 173 | } |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php |
— | — | @@ -1,10 +1,8 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
7 | 6 | class AbuseFilterViewEdit extends AbuseFilterView { |
8 | | - |
9 | 7 | function __construct( $page, $params ) { |
10 | 8 | parent::__construct( $page, $params ); |
11 | 9 | $this->mFilter = $page->mFilter; |
— | — | @@ -24,14 +22,14 @@ |
25 | 23 | } |
26 | 24 | |
27 | 25 | $editToken = $wgRequest->getVal( 'wpEditToken' ); |
28 | | - $didEdit = $this->canEdit() |
| 26 | + $didEdit = $this->canEdit() |
29 | 27 | && $wgUser->matchEditToken( $editToken, array( 'abusefilter', $filter ) ); |
30 | 28 | |
31 | 29 | if ( $didEdit ) { |
32 | 30 | // Check syntax |
33 | 31 | $syntaxerr = AbuseFilter::checkSyntax( $wgRequest->getVal( 'wpFilterRules' ) ); |
34 | 32 | if ( $syntaxerr !== true ) { |
35 | | - $wgOut->addHTML( |
| 33 | + $wgOut->addHTML( |
36 | 34 | $this->buildFilterEditor( |
37 | 35 | wfMsgExt( |
38 | 36 | 'abusefilter-edit-badsyntax', |
— | — | @@ -66,8 +64,8 @@ |
67 | 65 | global $wgAbuseFilterRestrictedActions; |
68 | 66 | if ( |
69 | 67 | array_intersect( |
70 | | - $wgAbuseFilterRestrictedActions, |
71 | | - array_keys( array_filter( $actions ) ) ) |
| 68 | + $wgAbuseFilterRestrictedActions, |
| 69 | + array_keys( array_filter( $actions ) ) ) |
72 | 70 | && !$wgUser->isAllowed( 'abusefilter-modify-restricted' ) ) |
73 | 71 | { |
74 | 72 | $wgOut->addHTML( |
— | — | @@ -83,7 +81,7 @@ |
84 | 82 | // If we've activated the 'tag' option, check the arguments for validity. |
85 | 83 | if ( !empty( $actions['tag'] ) ) { |
86 | 84 | $bad = false; |
87 | | - foreach( $actions['tag']['parameters'] as $tag ) { |
| 85 | + foreach ( $actions['tag']['parameters'] as $tag ) { |
88 | 86 | $t = Title::makeTitleSafe( NS_MEDIAWIKI, 'tag-' . $tag ); |
89 | 87 | if ( !$t ) { |
90 | 88 | $bad = true; |
— | — | @@ -134,9 +132,9 @@ |
135 | 133 | global $wgAbuseFilterAvailableActions; |
136 | 134 | $deadActions = array(); |
137 | 135 | $actionsRows = array(); |
138 | | - foreach( $wgAbuseFilterAvailableActions as $action ) { |
| 136 | + foreach ( $wgAbuseFilterAvailableActions as $action ) { |
139 | 137 | // Check if it's set |
140 | | - $enabled = isset($actions[$action]) && (bool)$actions[$action]; |
| 138 | + $enabled = isset( $actions[$action] ) && (bool)$actions[$action]; |
141 | 139 | |
142 | 140 | if ( $enabled ) { |
143 | 141 | $parameters = $actions[$action]['parameters']; |
— | — | @@ -155,13 +153,13 @@ |
156 | 154 | // Create a history row |
157 | 155 | $afh_row = array(); |
158 | 156 | |
159 | | - foreach( AbuseFilter::$history_mappings as $af_col => $afh_col ) { |
| 157 | + foreach ( AbuseFilter::$history_mappings as $af_col => $afh_col ) { |
160 | 158 | $afh_row[$afh_col] = $newRow[$af_col]; |
161 | 159 | } |
162 | 160 | |
163 | 161 | // Actions |
164 | 162 | $displayActions = array(); |
165 | | - foreach( $actions as $action ) { |
| 163 | + foreach ( $actions as $action ) { |
166 | 164 | $displayActions[$action['action']] = $action['parameters']; |
167 | 165 | } |
168 | 166 | $afh_row['afh_actions'] = serialize( $displayActions ); |
— | — | @@ -209,25 +207,25 @@ |
210 | 208 | |
211 | 209 | global $wgOut; |
212 | 210 | |
213 | | - $wgOut->redirect( |
| 211 | + $wgOut->redirect( |
214 | 212 | $this->getTitle()->getLocalURL( 'result=success&changedfilter=' . $new_id ) ); |
215 | 213 | } else { |
216 | 214 | if ( $history_id ) { |
217 | | - $wgOut->addWikiMsg( |
| 215 | + $wgOut->addWikiMsg( |
218 | 216 | 'abusefilter-edit-oldwarning', $this->mHistoryID, $this->mFilter ); |
219 | 217 | } |
220 | 218 | |
221 | 219 | $wgOut->addHTML( $this->buildFilterEditor( null, $this->mFilter, $history_id ) ); |
222 | 220 | |
223 | 221 | if ( $history_id ) { |
224 | | - $wgOut->addWikiMsg( |
| 222 | + $wgOut->addWikiMsg( |
225 | 223 | 'abusefilter-edit-oldwarning', $this->mHistoryID, $this->mFilter ); |
226 | 224 | } |
227 | 225 | } |
228 | 226 | } |
229 | 227 | |
230 | 228 | function buildFilterEditor( $error, $filter, $history_id = null ) { |
231 | | - if( $filter === null ) { |
| 229 | + if ( $filter === null ) { |
232 | 230 | return false; |
233 | 231 | } |
234 | 232 | |
— | — | @@ -238,7 +236,7 @@ |
239 | 237 | // Load from request OR database. |
240 | 238 | list( $row, $actions ) = $this->loadRequest( $filter, $history_id ); |
241 | 239 | |
242 | | - if( !$row ) { |
| 240 | + if ( !$row ) { |
243 | 241 | $wgOut->addWikiMsg( 'abusefilter-edit-badfilter' ); |
244 | 242 | $wgOut->addHTML( $sk->link( $this->getTitle(), wfMsg( 'abusefilter-return' ) ) ); |
245 | 243 | return; |
— | — | @@ -269,7 +267,7 @@ |
270 | 268 | |
271 | 269 | $fields = array(); |
272 | 270 | |
273 | | - $fields['abusefilter-edit-id'] = |
| 271 | + $fields['abusefilter-edit-id'] = |
274 | 272 | $this->mFilter == 'new' ? wfMsg( 'abusefilter-edit-new' ) : $filter; |
275 | 273 | $fields['abusefilter-edit-description'] = |
276 | 274 | Xml::input( |
— | — | @@ -280,7 +278,7 @@ |
281 | 279 | ); |
282 | 280 | |
283 | 281 | // Hit count display |
284 | | - if( !empty( $row->af_hit_count ) ){ |
| 282 | + if ( !empty( $row->af_hit_count ) ) { |
285 | 283 | $count = (int)$row->af_hit_count; |
286 | 284 | $count_display = wfMsgExt( 'abusefilter-hitcount', array( 'parseinline' ), |
287 | 285 | $wgLang->formatNum( $count ) |
— | — | @@ -303,7 +301,7 @@ |
304 | 302 | if ( $total > 0 ) { |
305 | 303 | $matches_percent = sprintf( '%.2f', 100 * $matches_count / $total ); |
306 | 304 | list( $timeProfile, $condProfile ) = AbuseFilter::getFilterProfile( $filter ); |
307 | | - |
| 305 | + |
308 | 306 | $fields['abusefilter-edit-status-label'] = |
309 | 307 | wfMsgExt( 'abusefilter-edit-status', array( 'parsemag', 'escape' ), |
310 | 308 | array( |
— | — | @@ -347,7 +345,7 @@ |
348 | 346 | ); |
349 | 347 | } |
350 | 348 | |
351 | | - foreach( $checkboxes as $checkboxId ) { |
| 349 | + foreach ( $checkboxes as $checkboxId ) { |
352 | 350 | $message = "abusefilter-edit-$checkboxId"; |
353 | 351 | $dbField = "af_$checkboxId"; |
354 | 352 | $postVar = 'wpFilter' . ucfirst( $checkboxId ); |
— | — | @@ -362,8 +360,10 @@ |
363 | 361 | $checkbox = Xml::tags( 'p', null, $checkbox ); |
364 | 362 | $flags .= $checkbox; |
365 | 363 | } |
| 364 | + |
366 | 365 | $fields['abusefilter-edit-flags'] = $flags; |
367 | 366 | $tools = ''; |
| 367 | + |
368 | 368 | if ( $filter != 'new' && $wgUser->isAllowed( 'abusefilter-revert' ) ) { |
369 | 369 | $tools .= Xml::tags( |
370 | 370 | 'p', null, |
— | — | @@ -381,7 +381,7 @@ |
382 | 382 | $sk->link( |
383 | 383 | $this->getTitle( "test/$filter" ), |
384 | 384 | wfMsgExt( 'abusefilter-edit-test-link', 'parseinline' ) |
385 | | - ) |
| 385 | + ) |
386 | 386 | ); |
387 | 387 | // Last modification details |
388 | 388 | $userLink = |
— | — | @@ -397,7 +397,7 @@ |
398 | 398 | $wgLang->date( $row->af_timestamp, true ), |
399 | 399 | $wgLang->time( $row->af_timestamp, true ), |
400 | 400 | $user |
401 | | - ) |
| 401 | + ) |
402 | 402 | ); |
403 | 403 | $history_display = wfMsgExt( 'abusefilter-edit-viewhistory', array( 'parseinline' ) ); |
404 | 404 | $fields['abusefilter-edit-history'] = |
— | — | @@ -424,9 +424,9 @@ |
425 | 425 | |
426 | 426 | if ( $this->canEdit() ) { |
427 | 427 | $form .= Xml::submitButton( wfMsg( 'abusefilter-edit-save' ) ); |
428 | | - $form .= Xml::hidden( |
429 | | - 'wpEditToken', |
430 | | - $wgUser->editToken( array( 'abusefilter', $filter ) ) |
| 428 | + $form .= Xml::hidden( |
| 429 | + 'wpEditToken', |
| 430 | + $wgUser->editToken( array( 'abusefilter', $filter ) ) |
431 | 431 | ); |
432 | 432 | } |
433 | 433 | |
— | — | @@ -445,15 +445,16 @@ |
446 | 446 | |
447 | 447 | function buildConsequenceEditor( $row, $actions ) { |
448 | 448 | global $wgAbuseFilterAvailableActions; |
| 449 | + |
449 | 450 | $setActions = array(); |
450 | | - foreach( $wgAbuseFilterAvailableActions as $action ) { |
| 451 | + foreach ( $wgAbuseFilterAvailableActions as $action ) { |
451 | 452 | $setActions[$action] = array_key_exists( $action, $actions ); |
452 | 453 | } |
453 | 454 | |
454 | 455 | $output = ''; |
455 | 456 | |
456 | | - foreach( $wgAbuseFilterAvailableActions as $action ) { |
457 | | - $output .= $this->buildConsequenceSelector( |
| 457 | + foreach ( $wgAbuseFilterAvailableActions as $action ) { |
| 458 | + $output .= $this->buildConsequenceSelector( |
458 | 459 | $action, $setActions[$action], @$actions[$action]['parameters'] ); |
459 | 460 | } |
460 | 461 | |
— | — | @@ -508,7 +509,7 @@ |
509 | 510 | array( |
510 | 511 | Xml::input( 'wpFilterThrottlePeriod', 20, $throttlePeriod, |
511 | 512 | $readOnlyAttrib |
512 | | - ) ) |
| 513 | + ) ) |
513 | 514 | ); |
514 | 515 | $throttleFields['abusefilter-edit-throttle-groups'] = |
515 | 516 | Xml::textarea( 'wpFilterThrottleGroups', $throttleGroups . "\n", |
— | — | @@ -521,28 +522,28 @@ |
522 | 523 | ); |
523 | 524 | return $throttleSettings; |
524 | 525 | case 'flag': |
525 | | - $checkbox = Xml::checkLabel( |
526 | | - wfMsg( 'abusefilter-edit-action-flag' ), |
527 | | - 'wpFilterActionFlag', |
528 | | - "mw-abusefilter-action-checkbox-$action", |
529 | | - true, |
| 526 | + $checkbox = Xml::checkLabel( |
| 527 | + wfMsg( 'abusefilter-edit-action-flag' ), |
| 528 | + 'wpFilterActionFlag', |
| 529 | + "mw-abusefilter-action-checkbox-$action", |
| 530 | + true, |
530 | 531 | array( 'disabled' => '1', 'class' => 'mw-abusefilter-action-checkbox' ) ); |
531 | 532 | return Xml::tags( 'p', null, $checkbox ); |
532 | 533 | case 'warn': |
533 | 534 | $output = ''; |
534 | | - $checkbox = Xml::checkLabel( |
535 | | - wfMsg( 'abusefilter-edit-action-warn' ), |
536 | | - 'wpFilterActionWarn', |
537 | | - "mw-abusefilter-action-checkbox-$action", |
538 | | - $set, |
| 535 | + $checkbox = Xml::checkLabel( |
| 536 | + wfMsg( 'abusefilter-edit-action-warn' ), |
| 537 | + 'wpFilterActionWarn', |
| 538 | + "mw-abusefilter-action-checkbox-$action", |
| 539 | + $set, |
539 | 540 | array( 'class' => 'mw-abusefilter-action-checkbox' ) + $cbReadOnlyAttrib ); |
540 | 541 | $output .= Xml::tags( 'p', null, $checkbox ); |
541 | | - $warnMsg = empty($set) ? 'abusefilter-warning' : $parameters[0]; |
| 542 | + $warnMsg = empty( $set ) ? 'abusefilter-warning' : $parameters[0]; |
542 | 543 | |
543 | 544 | $warnFields['abusefilter-edit-warn-message'] = |
544 | 545 | $this->getExistingSelector( $warnMsg ); |
545 | 546 | $warnFields['abusefilter-edit-warn-other-label'] = |
546 | | - Xml::input( |
| 547 | + Xml::input( |
547 | 548 | 'wpFilterWarnMessageOther', |
548 | 549 | 45, |
549 | 550 | $warnMsg ? $warnMsg : 'abusefilter-warning-', |
— | — | @@ -642,11 +643,11 @@ |
643 | 644 | $existingSelector->addOption( 'abusefilter-warning' ); |
644 | 645 | |
645 | 646 | global $wgLang; |
646 | | - while( $row = $dbr->fetchObject( $res ) ) { |
| 647 | + while ( $row = $dbr->fetchObject( $res ) ) { |
647 | 648 | if ( $wgLang->lcfirst( $row->page_title ) == $wgLang->lcfirst( $warnMsg ) ) { |
648 | 649 | $existingSelector->setDefault( $wgLang->lcfirst( $warnMsg ) ); |
649 | 650 | } |
650 | | - |
| 651 | + |
651 | 652 | if ( $row->page_title != 'Abusefilter-warning' ) { |
652 | 653 | $existingSelector->addOption( $wgLang->lcfirst( $row->page_title ) ); |
653 | 654 | } |
— | — | @@ -658,7 +659,6 @@ |
659 | 660 | } |
660 | 661 | |
661 | 662 | function loadFilterData( $id ) { |
662 | | - |
663 | 663 | if ( $id == 'new' ) { |
664 | 664 | $obj = new stdClass; |
665 | 665 | $obj->af_pattern = ''; |
— | — | @@ -724,7 +724,7 @@ |
725 | 725 | if ( !is_null( $actions ) && !is_null( $row ) ) { |
726 | 726 | return array( $row, $actions ); |
727 | 727 | } elseif ( $wgRequest->wasPosted() ) { |
728 | | - ## Nothing, we do it all later |
| 728 | + # Nothing, we do it all later |
729 | 729 | } elseif ( $history_id ) { |
730 | 730 | return $this->loadHistoryItem( $history_id ); |
731 | 731 | } else { |
— | — | @@ -754,7 +754,7 @@ |
755 | 755 | 'af_hidden', |
756 | 756 | ); |
757 | 757 | |
758 | | - foreach( $copy as $name ) { |
| 758 | + foreach ( $copy as $name ) { |
759 | 759 | $row->$name = $importRow->$name; |
760 | 760 | } |
761 | 761 | } else { |
— | — | @@ -764,7 +764,7 @@ |
765 | 765 | 'af_comments' => 'wpFilterNotes' |
766 | 766 | ); |
767 | 767 | |
768 | | - foreach( $textLoads as $col => $field ) { |
| 768 | + foreach ( $textLoads as $col => $field ) { |
769 | 769 | $row->$col = trim( $wgRequest->getVal( $field ) ); |
770 | 770 | } |
771 | 771 | |
— | — | @@ -777,7 +777,7 @@ |
778 | 778 | // Actions |
779 | 779 | global $wgAbuseFilterAvailableActions; |
780 | 780 | $actions = array(); |
781 | | - foreach( $wgAbuseFilterAvailableActions as $action ) { |
| 781 | + foreach ( $wgAbuseFilterAvailableActions as $action ) { |
782 | 782 | // Check if it's set |
783 | 783 | $enabled = $wgRequest->getBool( 'wpFilterAction' . ucfirst( $action ) ); |
784 | 784 | |
— | — | @@ -788,7 +788,7 @@ |
789 | 789 | // We need to load the parameters |
790 | 790 | $throttleCount = $wgRequest->getIntOrNull( 'wpFilterThrottleCount' ); |
791 | 791 | $throttlePeriod = $wgRequest->getIntOrNull( 'wpFilterThrottlePeriod' ); |
792 | | - $throttleGroups = explode( "\n", |
| 792 | + $throttleGroups = explode( "\n", |
793 | 793 | trim( $wgRequest->getText( 'wpFilterThrottleGroups' ) ) ); |
794 | 794 | |
795 | 795 | $parameters[0] = $this->mFilter; // For now, anyway |
— | — | @@ -804,7 +804,7 @@ |
805 | 805 | } elseif ( $action == 'tag' ) { |
806 | 806 | $parameters = explode( "\n", $wgRequest->getText( 'wpFilterTags' ) ); |
807 | 807 | } |
808 | | - |
| 808 | + |
809 | 809 | $thisAction = array( 'action' => $action, 'parameters' => $parameters ); |
810 | 810 | $actions[$action] = $thisAction; |
811 | 811 | } |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewExamine.php |
— | — | @@ -1,10 +1,8 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
7 | 6 | class AbuseFilterViewExamine extends AbuseFilterView { |
8 | | - |
9 | 7 | function show() { |
10 | 8 | global $wgOut, $wgUser; |
11 | 9 | |
— | — | @@ -32,11 +30,11 @@ |
33 | 31 | // Add selector |
34 | 32 | $selector = ''; |
35 | 33 | |
36 | | - $selectFields = array(); ## Same fields as in Test |
| 34 | + $selectFields = array(); # # Same fields as in Test |
37 | 35 | $selectFields['abusefilter-test-user'] = Xml::input( 'wpSearchUser', 45, $this->mSearchUser ); |
38 | | - $selectFields['abusefilter-test-period-start'] = |
| 36 | + $selectFields['abusefilter-test-period-start'] = |
39 | 37 | Xml::input( 'wpSearchPeriodStart', 45, $this->mSearchPeriodStart ); |
40 | | - $selectFields['abusefilter-test-period-end'] = |
| 38 | + $selectFields['abusefilter-test-period-end'] = |
41 | 39 | Xml::input( 'wpSearchPeriodEnd', 45, $this->mSearchPeriodEnd ); |
42 | 40 | |
43 | 41 | $selector .= Xml::buildForm( $selectFields, 'abusefilter-examine-submit' ); |
— | — | @@ -136,8 +134,8 @@ |
137 | 135 | $msg['nomatch'] = wfMsg( 'abusefilter-examine-nomatch' ); |
138 | 136 | $msg['syntaxerror'] = wfMsg( 'abusefilter-examine-syntaxerror' ); |
139 | 137 | $wgOut->addInlineScript( |
140 | | - "var wgMessageMatch = " . Xml::encodeJsVar( $msg['match'] ) . ";\n". |
141 | | - "var wgMessageNomatch = " . Xml::encodeJsVar( $msg['nomatch'] ) . ";\n". |
| 138 | + "var wgMessageMatch = " . Xml::encodeJsVar( $msg['match'] ) . ";\n" . |
| 139 | + "var wgMessageNomatch = " . Xml::encodeJsVar( $msg['nomatch'] ) . ";\n" . |
142 | 140 | "var wgMessageError = " . Xml::encodeJsVar( $msg['syntaxerror'] ) . ";\n" |
143 | 141 | ); |
144 | 142 | |
— | — | @@ -200,7 +198,7 @@ |
201 | 199 | // Normalise username |
202 | 200 | $userTitle = Title::newFromText( $searchUsername ); |
203 | 201 | |
204 | | - if ( $userTitle && $userTitle->getNamespace() == NS_USER ) |
| 202 | + if ( $userTitle && $userTitle->getNamespace() == NS_USER ) |
205 | 203 | $this->mSearchUser = $userTitle->getText(); // Allow User:Blah syntax. |
206 | 204 | elseif ( $userTitle ) |
207 | 205 | // Not sure of the value of prefixedText over text, but no need to munge unnecessarily. |
— | — | @@ -246,7 +244,7 @@ |
247 | 245 | } |
248 | 246 | |
249 | 247 | function formatRow( $row ) { |
250 | | - ## Incompatible stuff. |
| 248 | + # Incompatible stuff. |
251 | 249 | $rc = RecentChange::newFromRow( $row ); |
252 | 250 | $rc->counter = $this->mPage->mCounter++; |
253 | 251 | return $this->mChangesList->recentChangesLine( $rc, false ); |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewRevert.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | if ( !defined( 'MEDIAWIKI' ) ) |
5 | 4 | die(); |
6 | 5 | |
— | — | @@ -21,15 +20,15 @@ |
22 | 21 | return; |
23 | 22 | |
24 | 23 | $wgOut->addWikiMsg( 'abusefilter-revert-intro', $filter ); |
25 | | - $wgOut->setPageTitle( wfMsg('abusefilter-revert-title', $filter) ); |
| 24 | + $wgOut->setPageTitle( wfMsg( 'abusefilter-revert-title', $filter ) ); |
26 | 25 | |
27 | 26 | // First, the search form. |
28 | 27 | $searchFields = array(); |
29 | | - $searchFields['abusefilter-revert-filter'] = |
| 28 | + $searchFields['abusefilter-revert-filter'] = |
30 | 29 | Xml::element( 'strong', null, $filter ); |
31 | | - $searchFields['abusefilter-revert-periodstart'] = |
| 30 | + $searchFields['abusefilter-revert-periodstart'] = |
32 | 31 | Xml::input( 'wpPeriodStart', 45, $this->origPeriodStart ); |
33 | | - $searchFields['abusefilter-revert-periodend'] = |
| 32 | + $searchFields['abusefilter-revert-periodend'] = |
34 | 33 | Xml::input( 'wpPeriodEnd', 45, $this->origPeriodEnd ); |
35 | 34 | $searchForm = Xml::buildForm( $searchFields, 'abusefilter-revert-search' ); |
36 | 35 | $searchForm .= "\n" . Xml::hidden( 'submit', 1 ); |
— | — | @@ -55,12 +54,12 @@ |
56 | 55 | $results = $this->doLookup(); |
57 | 56 | $list = array(); |
58 | 57 | |
59 | | - foreach( $results as $result ) { |
| 58 | + foreach ( $results as $result ) { |
60 | 59 | $displayActions = array(); |
61 | 60 | |
62 | 61 | global $wgLang; |
63 | | - $displayActions = array_map( |
64 | | - array( 'AbuseFilter', 'getActionDisplay' ), |
| 62 | + $displayActions = array_map( |
| 63 | + array( 'AbuseFilter', 'getActionDisplay' ), |
65 | 64 | $result['actions'] ); |
66 | 65 | |
67 | 66 | $msg = wfMsgExt( |
— | — | @@ -76,7 +75,7 @@ |
77 | 76 | SpecialPage::getTitleFor( 'AbuseLog' ), |
78 | 77 | wfMsgNoTrans( 'abusefilter-log-detailslink' ), |
79 | 78 | array(), |
80 | | - array( 'details' =>$result['id'] ) |
| 79 | + array( 'details' => $result['id'] ) |
81 | 80 | ) |
82 | 81 | ) |
83 | 82 | ); |
— | — | @@ -86,7 +85,7 @@ |
87 | 86 | $wgOut->addHTML( Xml::tags( 'ul', null, implode( "\n", $list ) ) ); |
88 | 87 | |
89 | 88 | // Add a button down the bottom. |
90 | | - $confirmForm = |
| 89 | + $confirmForm = |
91 | 90 | Xml::hidden( 'editToken', $wgUser->editToken( "abusefilter-revert-$filter" ) ) . |
92 | 91 | Xml::hidden( 'title', $this->getTitle( "revert/$filter" )->getPrefixedText() ) . |
93 | 92 | Xml::hidden( 'wpPeriodStart', $this->origPeriodStart ) . |
— | — | @@ -102,7 +101,7 @@ |
103 | 102 | array( |
104 | 103 | 'action' => $this->getTitle( "revert/$filter" )->getLocalURL(), |
105 | 104 | 'method' => 'post' |
106 | | - ), |
| 105 | + ), |
107 | 106 | $confirmForm |
108 | 107 | ); |
109 | 108 | $wgOut->addHTML( $confirmForm ); |
— | — | @@ -119,9 +118,9 @@ |
120 | 119 | $dbr = wfGetDB( DB_SLAVE ); |
121 | 120 | |
122 | 121 | if ( $periodStart ) |
123 | | - $conds[] = 'afl_timestamp>'.$dbr->addQuotes( $dbr->timestamp( $periodStart ) ); |
| 122 | + $conds[] = 'afl_timestamp>' . $dbr->addQuotes( $dbr->timestamp( $periodStart ) ); |
124 | 123 | if ( $periodEnd ) |
125 | | - $conds[] = 'afl_timestamp<'.$dbr->addQuotes( $dbr->timestamp( $periodEnd ) ); |
| 124 | + $conds[] = 'afl_timestamp<' . $dbr->addQuotes( $dbr->timestamp( $periodEnd ) ); |
126 | 125 | |
127 | 126 | // Database query. |
128 | 127 | $res = $dbr->select( 'abuse_filter_log', '*', $conds, __METHOD__ ); |
— | — | @@ -171,9 +170,9 @@ |
172 | 171 | return false; |
173 | 172 | |
174 | 173 | $results = $this->doLookup(); |
175 | | - foreach( $results as $result ) { |
| 174 | + foreach ( $results as $result ) { |
176 | 175 | $actions = $result['actions']; |
177 | | - foreach( $actions as $action ) { |
| 176 | + foreach ( $actions as $action ) { |
178 | 177 | $this->revertAction( $action, $result ); |
179 | 178 | } |
180 | 179 | } |
— | — | @@ -201,7 +200,7 @@ |
202 | 201 | break; |
203 | 202 | case 'blockautopromote': |
204 | 203 | global $wgMemc; |
205 | | - $wgMemc->delete( AbuseFilter::autopromoteBlockKey( |
| 204 | + $wgMemc->delete( AbuseFilter::autopromoteBlockKey( |
206 | 205 | User::newFromId( $result['userid'] ) ) ); |
207 | 206 | break; |
208 | 207 | case 'degroup': |
— | — | @@ -214,7 +213,7 @@ |
215 | 214 | ); |
216 | 215 | |
217 | 216 | $rows = array(); |
218 | | - foreach( $oldGroups as $group ) { |
| 217 | + foreach ( $oldGroups as $group ) { |
219 | 218 | $rows[] = array( 'ug_user' => $result['userid'], 'ug_group' => $group ); |
220 | 219 | } |
221 | 220 | |
— | — | @@ -238,7 +237,7 @@ |
239 | 238 | $this->mPage->mFilter, |
240 | 239 | $this->mReason |
241 | 240 | ), |
242 | | - array( implode( ',', $currentGroups ), implode( ',', $newGroups ) ) |
| 241 | + array( implode( ',', $currentGroups ), implode( ',', $newGroups ) ) |
243 | 242 | ); |
244 | 243 | } |
245 | 244 | } |
Index: trunk/extensions/AbuseFilter/ApiQueryAbuseFilters.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Created on Mar 29, 2009 |
6 | 5 | * |
— | — | @@ -31,14 +30,13 @@ |
32 | 31 | * @ingroup Extensions |
33 | 32 | */ |
34 | 33 | class ApiQueryAbuseFilters extends ApiQueryBase { |
35 | | - |
36 | 34 | public function __construct( $query, $moduleName ) { |
37 | 35 | parent::__construct( $query, $moduleName, 'abf' ); |
38 | 36 | } |
39 | 37 | |
40 | 38 | public function execute() { |
41 | 39 | global $wgUser; |
42 | | - if( !$wgUser->isAllowed( 'abusefilter-view' ) ) |
| 40 | + if ( !$wgUser->isAllowed( 'abusefilter-view' ) ) |
43 | 41 | $this->dieUsage( 'You don\'t have permission to view abuse filters', 'permissiondenied' ); |
44 | 42 | |
45 | 43 | $params = $this->extractRequestParams(); |
— | — | @@ -80,8 +78,8 @@ |
81 | 79 | |
82 | 80 | /* Check for conflicting parameters. */ |
83 | 81 | if ( ( isset( $show['enabled'] ) && isset( $show['!enabled'] ) ) |
84 | | - || ( isset( $show['deleted']) && isset( $show['!deleted'] ) ) |
85 | | - || ( isset( $show['private']) && isset( $show['!private'] ) ) ) { |
| 82 | + || ( isset( $show['deleted'] ) && isset( $show['!deleted'] ) ) |
| 83 | + || ( isset( $show['private'] ) && isset( $show['!private'] ) ) ) { |
86 | 84 | $this->dieUsage( 'Incorrect parameter - mutually exclusive values may not be supplied', 'show' ); |
87 | 85 | } |
88 | 86 | |
— | — | @@ -98,40 +96,40 @@ |
99 | 97 | $showhidden = $wgUser->isAllowed( 'abusefilter-modify' ); |
100 | 98 | |
101 | 99 | $count = 0; |
102 | | - while( $row = $res->fetchObject() ) { |
103 | | - if( ++$count > $params['limit'] ) { |
| 100 | + while ( $row = $res->fetchObject() ) { |
| 101 | + if ( ++$count > $params['limit'] ) { |
104 | 102 | // We've had enough |
105 | 103 | $this->setContinueEnumParameter( 'startid', $row->af_id ); |
106 | 104 | break; |
107 | 105 | } |
108 | 106 | $entry = array(); |
109 | | - if( $fld_id ) |
110 | | - $entry['id'] = intval($row->af_id); |
111 | | - if( $fld_desc ) |
| 107 | + if ( $fld_id ) |
| 108 | + $entry['id'] = intval( $row->af_id ); |
| 109 | + if ( $fld_desc ) |
112 | 110 | $entry['description'] = $row->af_public_comments; |
113 | | - if( $fld_pattern && ( !$row->af_hidden || $showhidden ) ) |
| 111 | + if ( $fld_pattern && ( !$row->af_hidden || $showhidden ) ) |
114 | 112 | $entry['pattern'] = $row->af_pattern; |
115 | | - if( $fld_actions ) |
| 113 | + if ( $fld_actions ) |
116 | 114 | $entry['actions'] = $row->af_actions; |
117 | | - if( $fld_hits ) |
| 115 | + if ( $fld_hits ) |
118 | 116 | $entry['hits'] = intval( $row->af_hit_count ); |
119 | | - if( $fld_comments && ( !$row->af_hidden || $showhidden ) ) |
| 117 | + if ( $fld_comments && ( !$row->af_hidden || $showhidden ) ) |
120 | 118 | $entry['comments'] = $row->af_comments; |
121 | | - if( $fld_user ) |
| 119 | + if ( $fld_user ) |
122 | 120 | $entry['lasteditor'] = $row->af_user_text; |
123 | | - if( $fld_time ) |
| 121 | + if ( $fld_time ) |
124 | 122 | $entry['lastedittime'] = wfTimestamp( TS_ISO_8601, $row->af_timestamp ); |
125 | | - if( $fld_private && $row->af_hidden ) |
| 123 | + if ( $fld_private && $row->af_hidden ) |
126 | 124 | $entry['private'] = ''; |
127 | | - if( $fld_status ) { |
128 | | - if( $row->af_enabled ) |
| 125 | + if ( $fld_status ) { |
| 126 | + if ( $row->af_enabled ) |
129 | 127 | $entry['enabled'] = ''; |
130 | | - if( $row->af_deleted ) |
| 128 | + if ( $row->af_deleted ) |
131 | 129 | $entry['deleted'] = ''; |
132 | 130 | } |
133 | 131 | if ( $entry ) { |
134 | 132 | $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $entry ); |
135 | | - if( !$fit ) { |
| 133 | + if ( !$fit ) { |
136 | 134 | $this->setContinueEnumParameter( 'startid', $row->af_id ); |
137 | 135 | break; |
138 | 136 | } |
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -3,7 +3,6 @@ |
4 | 4 | die(); |
5 | 5 | |
6 | 6 | class AbuseFilter { |
7 | | - |
8 | 7 | public static $statsStoragePeriod = 86400; |
9 | 8 | public static $tokenCache = array(); |
10 | 9 | public static $modifyCache = array(); |
— | — | @@ -141,7 +140,7 @@ |
142 | 141 | |
143 | 142 | $links = array(); |
144 | 143 | |
145 | | - foreach( $linkDefs as $name => $page ) { |
| 144 | + foreach ( $linkDefs as $name => $page ) { |
146 | 145 | $msgName = "abusefilter-topnav-$name"; |
147 | 146 | |
148 | 147 | if ( isset( $msgOverrides[$name] ) ) |
— | — | @@ -285,7 +284,7 @@ |
286 | 285 | |
287 | 286 | // Use restrictions. |
288 | 287 | global $wgRestrictionTypes; |
289 | | - foreach( $wgRestrictionTypes as $action ) { |
| 288 | + foreach ( $wgRestrictionTypes as $action ) { |
290 | 289 | $vars->setLazyLoadVar( "{$prefix}_restrictions_$action", 'get-page-restrictions', |
291 | 290 | array( 'title' => $title->getText(), |
292 | 291 | 'namespace' => $title->getNamespace(), |
— | — | @@ -434,7 +433,7 @@ |
435 | 434 | } |
436 | 435 | |
437 | 436 | public static function checkFilter( $row, $vars, $profile = false, $prefix = '' ) { |
438 | | - $filterID = $prefix.$row->af_id; |
| 437 | + $filterID = $prefix . $row->af_id; |
439 | 438 | |
440 | 439 | if ( $profile ) { |
441 | 440 | $startConds = self::$condCount; |
— | — | @@ -490,7 +489,7 @@ |
491 | 490 | |
492 | 491 | if ( $curCount ) { |
493 | 492 | $wgMemc->set( $totalCondKey, $curTotalConds + $conds, 3600 ); |
494 | | - $wgMemc->set( $totalKey, $curTotal + $time, 3600 ); |
| 493 | + $wgMemc->set( $totalKey, $curTotal + $time, 3600 ); |
495 | 494 | $wgMemc->incr( $countKey ); |
496 | 495 | } else { |
497 | 496 | $wgMemc->set( $countKey, 1, 3600 ); |
— | — | @@ -514,7 +513,7 @@ |
515 | 514 | return array( 0, 0 ); |
516 | 515 | |
517 | 516 | $timeProfile = ( $curTotal / $curCount ) * 1000; // 1000 ms in a sec |
518 | | - $timeProfile = round( $timeProfile, 2); // Return in ms, rounded to 2dp |
| 517 | + $timeProfile = round( $timeProfile, 2 ); // Return in ms, rounded to 2dp |
519 | 518 | |
520 | 519 | $condProfile = ( $curTotalConds / $curCount ); |
521 | 520 | $condProfile = round( $condProfile, 0 ); |
— | — | @@ -535,7 +534,7 @@ |
536 | 535 | $globalFilters = array(); |
537 | 536 | $localFilters = array(); |
538 | 537 | |
539 | | - foreach( $filters as $filter ) { |
| 538 | + foreach ( $filters as $filter ) { |
540 | 539 | $globalIndex = self::decodeGlobalName( $filter ); |
541 | 540 | |
542 | 541 | if ( $globalIndex ) |
— | — | @@ -565,7 +564,7 @@ |
566 | 565 | |
567 | 566 | public static function loadConsequencesFromDB( $dbr, $filters, $prefix = '' ) { |
568 | 567 | $actionsByFilter = array(); |
569 | | - foreach( $filters as $filter ) { |
| 568 | + foreach ( $filters as $filter ) { |
570 | 569 | $actionsByFilter[$prefix . $filter] = array(); |
571 | 570 | } |
572 | 571 | |
— | — | @@ -584,7 +583,7 @@ |
585 | 584 | if ( $row->af_throttled |
586 | 585 | && in_array( $row->afa_consequence, $wgAbuseFilterRestrictedActions ) ) |
587 | 586 | { |
588 | | - ## Don't do the action |
| 587 | + # # Don't do the action |
589 | 588 | } elseif ( $row->afa_filter != $row->af_id ) { |
590 | 589 | // We probably got a NULL, as it's a LEFT JOIN. |
591 | 590 | // Don't add it. |
— | — | @@ -616,7 +615,7 @@ |
617 | 616 | |
618 | 617 | $messages = array(); |
619 | 618 | |
620 | | - foreach( $actionsByFilter as $filter => $actions ) { |
| 619 | + foreach ( $actionsByFilter as $filter => $actions ) { |
621 | 620 | // Special-case handling for warnings. |
622 | 621 | global $wgOut; |
623 | 622 | $parsed_public_comments = $wgOut->parseInline( |
— | — | @@ -630,13 +629,13 @@ |
631 | 630 | $hitThrottle = false; |
632 | 631 | |
633 | 632 | // The rest are throttle-types. |
634 | | - foreach( $parameters as $throttleType ) { |
| 633 | + foreach ( $parameters as $throttleType ) { |
635 | 634 | $hitThrottle = $hitThrottle || self::isThrottled( |
636 | 635 | $throttleId, $throttleType, $title, $rateCount, $ratePeriod ); |
637 | 636 | } |
638 | 637 | |
639 | 638 | unset( $actions['throttle'] ); |
640 | | - if (!$hitThrottle) { |
| 639 | + if ( !$hitThrottle ) { |
641 | 640 | $actionsTaken[$filter][] = 'throttle'; |
642 | 641 | continue; |
643 | 642 | } |
— | — | @@ -675,7 +674,7 @@ |
676 | 675 | } |
677 | 676 | |
678 | 677 | // Do the rest of the actions |
679 | | - foreach( $actions as $action => $info ) { |
| 678 | + foreach ( $actions as $action => $info ) { |
680 | 679 | $newMsg = self::takeConsequenceAction( |
681 | 680 | $action, $info['parameters'], $title, $vars, |
682 | 681 | self::$filters[$filter]->af_public_comments |
— | — | @@ -727,7 +726,7 @@ |
728 | 727 | $log_template = array( |
729 | 728 | 'afl_user' => $wgUser->getId(), |
730 | 729 | 'afl_user_text' => $wgUser->getName(), |
731 | | - 'afl_timestamp' => $dbr->timestamp(wfTimestampNow()), |
| 730 | + 'afl_timestamp' => $dbr->timestamp( wfTimestampNow() ), |
732 | 731 | 'afl_namespace' => $title->getNamespace(), |
733 | 732 | 'afl_title' => $title->getDBkey(), |
734 | 733 | 'afl_ip' => wfGetIP() |
— | — | @@ -762,7 +761,7 @@ |
763 | 762 | $logged_local_filters = array(); |
764 | 763 | $logged_global_filters = array(); |
765 | 764 | |
766 | | - foreach( $actions_taken as $filter => $actions ) { |
| 765 | + foreach ( $actions_taken as $filter => $actions ) { |
767 | 766 | $globalIndex = self::decodeGlobalName( $filter ); |
768 | 767 | $thisLog = $log_template; |
769 | 768 | $thisLog['afl_filter'] = $filter; |
— | — | @@ -800,7 +799,7 @@ |
801 | 800 | $var_dump = self::storeVarDump( $vars ); |
802 | 801 | $var_dump = "stored-text:$var_dump"; // To distinguish from stuff stored directly |
803 | 802 | |
804 | | - foreach( $log_rows as $index => $data ) { |
| 803 | + foreach ( $log_rows as $index => $data ) { |
805 | 804 | $log_rows[$index]['afl_var_dump'] = $var_dump; |
806 | 805 | } |
807 | 806 | |
— | — | @@ -827,7 +826,7 @@ |
828 | 827 | $vars->computeDBVars(); |
829 | 828 | $global_var_dump = self::storeVarDump( $vars, 'global' ); |
830 | 829 | $global_var_dump = "stored-text:$global_var_dump"; |
831 | | - foreach( $central_log_rows as $index => $data ) { |
| 830 | + foreach ( $central_log_rows as $index => $data ) { |
832 | 831 | $central_log_rows[$index]['afl_var_dump'] = $global_var_dump; |
833 | 832 | } |
834 | 833 | |
— | — | @@ -867,7 +866,7 @@ |
868 | 867 | |
869 | 868 | $flags = array(); |
870 | 869 | |
871 | | - if( $wgCompressRevisions ) { |
| 870 | + if ( $wgCompressRevisions ) { |
872 | 871 | if ( function_exists( 'gzdeflate' ) ) { |
873 | 872 | $text = gzdeflate( $text ); |
874 | 873 | $flags[] = 'gzip'; |
— | — | @@ -1054,7 +1053,7 @@ |
1055 | 1054 | // Remove all groups from the user. Ouch. |
1056 | 1055 | $groups = $wgUser->getGroups(); |
1057 | 1056 | |
1058 | | - foreach( $groups as $group ) { |
| 1057 | + foreach ( $groups as $group ) { |
1059 | 1058 | $wgUser->removeGroup( $group ); |
1060 | 1059 | } |
1061 | 1060 | |
— | — | @@ -1084,7 +1083,7 @@ |
1085 | 1084 | case 'blockautopromote': |
1086 | 1085 | global $wgUser, $wgMemc; |
1087 | 1086 | if ( !$wgUser->isAnon() ) { |
1088 | | - $blockPeriod = (int)mt_rand( 3*86400, 7*86400 ); // Block for 3-7 days. |
| 1087 | + $blockPeriod = (int)mt_rand( 3 * 86400, 7 * 86400 ); // Block for 3-7 days. |
1089 | 1088 | $wgMemc->set( self::autoPromoteBlockKey( $wgUser ), true, $blockPeriod ); |
1090 | 1089 | |
1091 | 1090 | $display .= wfMsgExt( 'abusefilter-autopromote-blocked', 'parseinline', |
— | — | @@ -1181,7 +1180,7 @@ |
1182 | 1181 | |
1183 | 1182 | $identifiers = array(); |
1184 | 1183 | |
1185 | | - foreach( $types as $subtype ) { |
| 1184 | + foreach ( $types as $subtype ) { |
1186 | 1185 | $identifiers[] = self::throttleIdentifier( $subtype, $title ); |
1187 | 1186 | } |
1188 | 1187 | |
— | — | @@ -1219,7 +1218,7 @@ |
1220 | 1219 | $wgMemc->set( $total_key, 0, $storage_period ); |
1221 | 1220 | $wgMemc->set( $overflow_key, 0, $storage_period ); |
1222 | 1221 | |
1223 | | - foreach( $filters as $filter => $matched ) { |
| 1222 | + foreach ( $filters as $filter => $matched ) { |
1224 | 1223 | $wgMemc->set( self::filterMatchesKey( $filter ), 0, $storage_period ); |
1225 | 1224 | } |
1226 | 1225 | $wgMemc->set( self::filterMatchesKey(), 0, $storage_period ); |
— | — | @@ -1239,7 +1238,7 @@ |
1240 | 1239 | global $wgAbuseFilterEmergencyDisableThreshold, $wgAbuseFilterEmergencyDisableCount, |
1241 | 1240 | $wgAbuseFilterEmergencyDisableAge, $wgMemc; |
1242 | 1241 | |
1243 | | - foreach( $filters as $filter ) { |
| 1242 | + foreach ( $filters as $filter ) { |
1244 | 1243 | // Increment counter |
1245 | 1244 | $matchCount = $wgMemc->get( self::filterMatchesKey( $filter ) ); |
1246 | 1245 | |
— | — | @@ -1340,14 +1339,14 @@ |
1341 | 1340 | |
1342 | 1341 | $builder .= Xml::option( wfMsg( 'abusefilter-edit-builder-select' ) ); |
1343 | 1342 | |
1344 | | - foreach( $dropDown as $group => $values ) { |
| 1343 | + foreach ( $dropDown as $group => $values ) { |
1345 | 1344 | $builder .= |
1346 | 1345 | Xml::openElement( |
1347 | 1346 | 'optgroup', |
1348 | 1347 | array( 'label' => wfMsg( "abusefilter-edit-builder-group-$group" ) ) |
1349 | 1348 | ) . "\n"; |
1350 | 1349 | |
1351 | | - foreach( $values as $content => $name ) { |
| 1350 | + foreach ( $values as $content => $name ) { |
1352 | 1351 | $builder .= |
1353 | 1352 | Xml::option( |
1354 | 1353 | wfMsg( "abusefilter-edit-builder-$group-$name" ), |
— | — | @@ -1362,7 +1361,7 @@ |
1363 | 1362 | Xml::tags( |
1364 | 1363 | 'select', |
1365 | 1364 | array( 'id' => 'wpFilterBuilder', 'onchange' => 'addText();' ), |
1366 | | - $builder |
| 1365 | + $builder |
1367 | 1366 | ) . ' '; |
1368 | 1367 | |
1369 | 1368 | // Add syntax checking |
— | — | @@ -1375,8 +1374,8 @@ |
1376 | 1375 | ) + $noTestAttrib ); |
1377 | 1376 | |
1378 | 1377 | if ( $addResultDiv ) |
1379 | | - $rules .= Xml::element( 'div', |
1380 | | - array( 'id' => 'mw-abusefilter-syntaxresult', 'style' => 'display: none;' ), |
| 1378 | + $rules .= Xml::element( 'div', |
| 1379 | + array( 'id' => 'mw-abusefilter-syntaxresult', 'style' => 'display: none;' ), |
1381 | 1380 | ' ' ); |
1382 | 1381 | |
1383 | 1382 | // Add script |
— | — | @@ -1386,7 +1385,7 @@ |
1387 | 1386 | // Import localisation. |
1388 | 1387 | $importMessages = array( 'abusefilter-edit-syntaxok', 'abusefilter-edit-syntaxerr' ); |
1389 | 1388 | $msgData = array(); |
1390 | | - foreach( $importMessages as $msg ) { |
| 1389 | + foreach ( $importMessages as $msg ) { |
1391 | 1390 | $msgData[$msg] = wfMsg( $msg ); |
1392 | 1391 | } |
1393 | 1392 | $editScript .= "\nvar wgAbuseFilterMessages = " . json_encode( $msgData ) . ";\n"; |
— | — | @@ -1415,20 +1414,20 @@ |
1416 | 1415 | list( $row1, $actions1 ) = $version_1; |
1417 | 1416 | list( $row2, $actions2 ) = $version_2; |
1418 | 1417 | |
1419 | | - foreach( $compareFields as $field ) { |
| 1418 | + foreach ( $compareFields as $field ) { |
1420 | 1419 | if ( $row1->$field != $row2->$field ) { |
1421 | 1420 | $differences[] = $field; |
1422 | 1421 | } |
1423 | 1422 | } |
1424 | 1423 | |
1425 | 1424 | global $wgAbuseFilterAvailableActions; |
1426 | | - foreach( $wgAbuseFilterAvailableActions as $action ) { |
| 1425 | + foreach ( $wgAbuseFilterAvailableActions as $action ) { |
1427 | 1426 | if ( !isset( $actions1[$action] ) && !isset( $actions2[$action] ) ) { |
1428 | 1427 | // They're both unset |
1429 | 1428 | } elseif ( isset( $actions1[$action] ) && isset( $actions2[$action] ) ) { |
1430 | 1429 | // They're both set. |
1431 | | - if ( array_diff( $actions1[$action]['parameters'], |
1432 | | - $actions2[$action]['parameters'] ) ) |
| 1430 | + if ( array_diff( $actions1[$action]['parameters'], |
| 1431 | + $actions2[$action]['parameters'] ) ) |
1433 | 1432 | { |
1434 | 1433 | // Different parameters |
1435 | 1434 | $differences[] = 'actions'; |
— | — | @@ -1443,31 +1442,31 @@ |
1444 | 1443 | } |
1445 | 1444 | |
1446 | 1445 | static function translateFromHistory( $row ) { |
1447 | | - ## Translate into an abuse_filter row with some black magic. |
1448 | | - ## This is ever so slightly evil! |
| 1446 | + # # Translate into an abuse_filter row with some black magic. |
| 1447 | + # # This is ever so slightly evil! |
1449 | 1448 | $af_row = new StdClass; |
1450 | 1449 | |
1451 | 1450 | foreach ( self::$history_mappings as $af_col => $afh_col ) { |
1452 | 1451 | $af_row->$af_col = $row->$afh_col; |
1453 | 1452 | } |
1454 | 1453 | |
1455 | | - ## Process flags |
| 1454 | + # # Process flags |
1456 | 1455 | |
1457 | 1456 | $af_row->af_deleted = 0; |
1458 | 1457 | $af_row->af_hidden = 0; |
1459 | 1458 | $af_row->af_enabled = 0; |
1460 | 1459 | |
1461 | 1460 | $flags = explode( ',', $row->afh_flags ); |
1462 | | - foreach( $flags as $flag ) { |
| 1461 | + foreach ( $flags as $flag ) { |
1463 | 1462 | $col_name = "af_$flag"; |
1464 | 1463 | $af_row->$col_name = 1; |
1465 | 1464 | } |
1466 | 1465 | |
1467 | | - ## Process actions |
| 1466 | + # # Process actions |
1468 | 1467 | $actions_raw = unserialize( $row->afh_actions ); |
1469 | 1468 | $actions_output = array(); |
1470 | 1469 | |
1471 | | - foreach( $actions_raw as $action => $parameters ) { |
| 1470 | + foreach ( $actions_raw as $action => $parameters ) { |
1472 | 1471 | $actions_output[$action] = array( 'action' => $action, 'parameters' => $parameters ); |
1473 | 1472 | } |
1474 | 1473 | |
— | — | @@ -1538,7 +1537,7 @@ |
1539 | 1538 | $vars->setVar( 'old_wikitext', '' ); |
1540 | 1539 | } |
1541 | 1540 | |
1542 | | - $vars->addHolder( self::getEditVars( |
| 1541 | + $vars->addHolder( self::getEditVars( |
1543 | 1542 | $title, $row->rc_this_oldid, $row->rc_last_oldid ) ); |
1544 | 1543 | |
1545 | 1544 | return $vars; |
— | — | @@ -1608,7 +1607,7 @@ |
1609 | 1608 | array( 'oldlink-var' => 'old_links', 'newlink-var' => 'all_links' ) ); |
1610 | 1609 | |
1611 | 1610 | $vars->setLazyLoadVar( 'new_html', 'parse-wikitext', |
1612 | | - array( |
| 1611 | + array( |
1613 | 1612 | 'namespace' => $title->getNamespace(), |
1614 | 1613 | 'title' => $title->getText(), |
1615 | 1614 | 'wikitext-var' => 'new_wikitext' |
— | — | @@ -1651,7 +1650,7 @@ |
1652 | 1651 | $output .= Xml::tags( 'tr', null, $header ) . "\n"; |
1653 | 1652 | |
1654 | 1653 | // Now, build the body of the table. |
1655 | | - foreach( $vars as $key => $value ) { |
| 1654 | + foreach ( $vars as $key => $value ) { |
1656 | 1655 | $key = strtolower( $key ); |
1657 | 1656 | |
1658 | 1657 | if ( !empty( $variableMessageMappings[$key] ) ) { |
— | — | @@ -1662,14 +1661,14 @@ |
1663 | 1662 | $keyDisplay = Xml::element( 'tt', null, $key ); |
1664 | 1663 | } |
1665 | 1664 | |
1666 | | - if( is_null( $value ) ) |
| 1665 | + if ( is_null( $value ) ) |
1667 | 1666 | $value = ''; |
1668 | 1667 | $value = Xml::element( 'div', array( 'class' => 'mw-abuselog-var-value' ), $value ); |
1669 | 1668 | |
1670 | 1669 | $trow = |
1671 | | - Xml::tags( 'td', array( 'class' => 'mw-abuselog-var' ), $keyDisplay ) . |
| 1670 | + Xml::tags( 'td', array( 'class' => 'mw-abuselog-var' ), $keyDisplay ) . |
1672 | 1671 | Xml::tags( 'td', array( 'class' => 'mw-abuselog-var-value' ), $value ); |
1673 | | - $output .= |
| 1672 | + $output .= |
1674 | 1673 | Xml::tags( 'tr', |
1675 | 1674 | array( 'class' => "mw-abuselog-details-$key mw-abuselog-value" ), $trow |
1676 | 1675 | ) . "\n"; |
— | — | @@ -1679,7 +1678,7 @@ |
1680 | 1679 | return $output; |
1681 | 1680 | } |
1682 | 1681 | |
1683 | | - static function modifyActionText( $page, $type, $title, $sk, $args ) { |
| 1682 | + static function modifyActionText( $page, $type, $title, $sk, $args ) { |
1684 | 1683 | list( $history_id, $filter_id ) = $args; |
1685 | 1684 | |
1686 | 1685 | $filter_link = $sk ? $sk->link( $title ) : $title->getFullURL(); |
— | — | @@ -1690,12 +1689,12 @@ |
1691 | 1690 | $sk ? $sk->link( $details_title, $details_text ) : $details_title->getFullURL(); |
1692 | 1691 | |
1693 | 1692 | return wfMsgExt( 'abusefilter-log-entry-modify', |
1694 | | - array('parseinline','replaceafter'), array( $filter_link, $details_link ) ); |
| 1693 | + array( 'parseinline', 'replaceafter' ), array( $filter_link, $details_link ) ); |
1695 | 1694 | } |
1696 | 1695 | |
1697 | 1696 | static function formatAction( $action, $parameters ) { |
1698 | 1697 | global $wgLang; |
1699 | | - if( count( $parameters ) == 0 ) { |
| 1698 | + if ( count( $parameters ) == 0 ) { |
1700 | 1699 | $displayAction = AbuseFilter::getActionDisplay( $action ); |
1701 | 1700 | } else { |
1702 | 1701 | $displayAction = AbuseFilter::getActionDisplay( $action ) . |
— | — | @@ -1709,7 +1708,7 @@ |
1710 | 1709 | global $wgLang; |
1711 | 1710 | $flags = array_filter( explode( ',', $value ) ); |
1712 | 1711 | $flags_display = array(); |
1713 | | - foreach( $flags as $flag ) { |
| 1712 | + foreach ( $flags as $flag ) { |
1714 | 1713 | $flags_display[] = wfMsg( "abusefilter-history-$flag" ); |
1715 | 1714 | } |
1716 | 1715 | return $wgLang->commaList( $flags_display ); |
Index: trunk/extensions/AbuseFilter/AbuseFilterVariableHolder.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | class AbuseFilterVariableHolder { |
5 | 4 | var $mVars = array(); |
6 | 5 | static $varBlacklist = array( 'context' ); |
— | — | @@ -36,7 +35,7 @@ |
37 | 36 | static function merge() { |
38 | 37 | $newHolder = new AbuseFilterVariableHolder; |
39 | 38 | |
40 | | - foreach( func_get_args() as $addHolder ) { |
| 39 | + foreach ( func_get_args() as $addHolder ) { |
41 | 40 | $newHolder->addHolder( $addHolder ); |
42 | 41 | } |
43 | 42 | |
— | — | @@ -59,7 +58,7 @@ |
60 | 59 | $allVarNames = array_keys( $this->mVars ); |
61 | 60 | $exported = array(); |
62 | 61 | |
63 | | - foreach( $allVarNames as $varName ) { |
| 62 | + foreach ( $allVarNames as $varName ) { |
64 | 63 | if ( !in_array( $varName, self::$varBlacklist ) ) { |
65 | 64 | $exported[$varName] = $this->getVar( $varName )->toString(); |
66 | 65 | } |
— | — | @@ -88,7 +87,7 @@ |
89 | 88 | 'revision-text-by-timestamp' |
90 | 89 | ); |
91 | 90 | |
92 | | - foreach( $this->mVars as $name => $value ) { |
| 91 | + foreach ( $this->mVars as $name => $value ) { |
93 | 92 | if ( $value instanceof AFComputedVariable && |
94 | 93 | in_array( $value->mMethod, $dbTypes ) ) { |
95 | 94 | $value = $value->compute( $this ); |
— | — | @@ -96,7 +95,6 @@ |
97 | 96 | } |
98 | 97 | } |
99 | 98 | } |
100 | | - |
101 | 99 | } |
102 | 100 | |
103 | 101 | class AFComputedVariable { |
— | — | @@ -177,9 +175,9 @@ |
178 | 176 | if ( !$id ) { |
179 | 177 | return array(); |
180 | 178 | } |
181 | | - |
| 179 | + |
182 | 180 | $dbr = wfGetDB( DB_SLAVE ); |
183 | | - $res = $dbr->select( 'externallinks', array( 'el_to' ), |
| 181 | + $res = $dbr->select( 'externallinks', array( 'el_to' ), |
184 | 182 | array( 'el_from' => $id ), __METHOD__ ); |
185 | 183 | $links = array(); |
186 | 184 | while ( $row = $dbr->fetchObject( $res ) ) { |
— | — | @@ -205,7 +203,7 @@ |
206 | 204 | $line_prefix = $parameters['line-prefix']; |
207 | 205 | $diff_lines = explode( "\n", $diff ); |
208 | 206 | $interest_lines = array(); |
209 | | - foreach( $diff_lines as $line ) { |
| 207 | + foreach ( $diff_lines as $line ) { |
210 | 208 | if ( substr( $line, 0, 1 ) === $line_prefix ) { |
211 | 209 | $interest_lines[] = substr( $line, strlen( $line_prefix ) ); |
212 | 210 | } |
— | — | @@ -237,10 +235,10 @@ |
238 | 236 | $article = self::articleFromTitle( $parameters['namespace'], |
239 | 237 | $parameters['title'] ); |
240 | 238 | |
241 | | - if ( $vars->getVar( 'context' )->toString() == 'filter') { |
| 239 | + if ( $vars->getVar( 'context' )->toString() == 'filter' ) { |
242 | 240 | $links = $this->getLinksFromDB( $article ); |
243 | 241 | wfDebug( "AbuseFilter: loading old links from DB\n" ); |
244 | | - } else { |
| 242 | + } else { |
245 | 243 | wfDebug( "AbuseFilter: loading old links from Parser\n" ); |
246 | 244 | $textVar = $parameters['text-var']; |
247 | 245 | |
— | — | @@ -280,7 +278,7 @@ |
281 | 279 | $new_text = $vars->getVar( $textVar )->toString(); |
282 | 280 | $editInfo = $article->prepareTextForEdit( $new_text ); |
283 | 281 | $newHTML = $editInfo->output->getText(); |
284 | | - // Kill the PP limit comments. Ideally we'd just remove these by not setting the |
| 282 | + // Kill the PP limit comments. Ideally we'd just remove these by not setting the |
285 | 283 | // parser option, but then we can't share a parse operation with the edit, which is bad. |
286 | 284 | $result = preg_replace( '/<!--\s*NewPP limit report[^>]*-->\s*$/si', '', $newHTML ); |
287 | 285 | } else { |
— | — | @@ -323,7 +321,7 @@ |
324 | 322 | ); |
325 | 323 | |
326 | 324 | $users = array(); |
327 | | - while( $user = $dbr->fetchRow( $res ) ) { |
| 325 | + while ( $user = $dbr->fetchRow( $res ) ) { |
328 | 326 | $users[] = $user[0]; |
329 | 327 | } |
330 | 328 | $result = $users; |
Index: trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Created on Mar 28, 2009 |
6 | 5 | * |
— | — | @@ -31,14 +30,13 @@ |
32 | 31 | * @ingroup Extensions |
33 | 32 | */ |
34 | 33 | class ApiQueryAbuseLog extends ApiQueryBase { |
35 | | - |
36 | 34 | public function __construct( $query, $moduleName ) { |
37 | 35 | parent::__construct( $query, $moduleName, 'afl' ); |
38 | 36 | } |
39 | 37 | |
40 | 38 | public function execute() { |
41 | 39 | global $wgUser; |
42 | | - if( !$wgUser->isAllowed( 'abusefilter-log' ) ) |
| 40 | + if ( !$wgUser->isAllowed( 'abusefilter-log' ) ) |
43 | 41 | $this->dieUsage( 'You don\'t have permission to view the abuse log', 'permissiondenied' ); |
44 | 42 | |
45 | 43 | $params = $this->extractRequestParams(); |
— | — | @@ -54,9 +52,9 @@ |
55 | 53 | $fld_result = isset( $prop['result'] ); |
56 | 54 | $fld_timestamp = isset( $prop['timestamp'] ); |
57 | 55 | |
58 | | - if( $fld_ip && !$wgUser->isAllowed( 'abusefilter-private' ) ) |
| 56 | + if ( $fld_ip && !$wgUser->isAllowed( 'abusefilter-private' ) ) |
59 | 57 | $this->dieUsage( 'You don\'t have permission to view IP addresses', 'permissiondenied' ); |
60 | | - if( $fld_details && !$wgUser->isAllowed( 'abusefilter-log-detail' ) ) |
| 58 | + if ( $fld_details && !$wgUser->isAllowed( 'abusefilter-log-detail' ) ) |
61 | 59 | $this->dieUsage( 'You don\'t have permission to view detailed abuse log entries', 'permissiondenied' ); |
62 | 60 | |
63 | 61 | $result = $this->getResult(); |
— | — | @@ -70,7 +68,7 @@ |
71 | 69 | $this->addFieldsIf( 'afl_action', $fld_action ); |
72 | 70 | $this->addFieldsIf( 'afl_var_dump', $fld_details ); |
73 | 71 | $this->addFieldsIf( 'afl_actions', $fld_result ); |
74 | | - if( $fld_filter ) { |
| 72 | + if ( $fld_filter ) { |
75 | 73 | $this->addTables( 'abuse_filter' ); |
76 | 74 | $this->addFields( 'af_public_comments' ); |
77 | 75 | $this->addJoinConds( array( 'abuse_filter' => array( 'LEFT JOIN', |
— | — | @@ -81,8 +79,8 @@ |
82 | 80 | |
83 | 81 | $this->addWhereRange( 'afl_timestamp', $params['dir'], $params['start'], $params['end'] ); |
84 | 82 | |
85 | | - $this->addWhereIf( array('afl_user_text' => $params['user'] ), isset( $params['user'] ) ); |
86 | | - $this->addWhereIf( array('afl_filter' => $params['filter'] ), isset( $params['filter'] ) ); |
| 83 | + $this->addWhereIf( array( 'afl_user_text' => $params['user'] ), isset( $params['user'] ) ); |
| 84 | + $this->addWhereIf( array( 'afl_filter' => $params['filter'] ), isset( $params['filter'] ) ); |
87 | 85 | |
88 | 86 | $title = $params['title']; |
89 | 87 | if ( !is_null( $title ) ) { |
— | — | @@ -95,34 +93,34 @@ |
96 | 94 | $res = $this->select( __METHOD__ ); |
97 | 95 | |
98 | 96 | $count = 0; |
99 | | - while( $row = $res->fetchObject() ) { |
100 | | - if( ++$count > $params['limit'] ) { |
| 97 | + while ( $row = $res->fetchObject() ) { |
| 98 | + if ( ++$count > $params['limit'] ) { |
101 | 99 | // We've had enough |
102 | 100 | $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->afl_timestamp ) ); |
103 | 101 | break; |
104 | 102 | } |
105 | 103 | $entry = array(); |
106 | | - if( $fld_ids ) { |
| 104 | + if ( $fld_ids ) { |
107 | 105 | $entry['id'] = intval( $row->afl_id ); |
108 | 106 | $entry['filter_id'] = intval( $row->afl_filter ); |
109 | 107 | } |
110 | | - if( $fld_filter ) |
| 108 | + if ( $fld_filter ) |
111 | 109 | $entry['filter'] = $row->af_public_comments; |
112 | | - if( $fld_user ) |
| 110 | + if ( $fld_user ) |
113 | 111 | $entry['user'] = $row->afl_user_text; |
114 | | - if( $fld_ip ) |
| 112 | + if ( $fld_ip ) |
115 | 113 | $entry['ip'] = $row->afl_ip; |
116 | | - if( $fld_title ) { |
| 114 | + if ( $fld_title ) { |
117 | 115 | $title = Title::makeTitle( $row->afl_namespace, $row->afl_title ); |
118 | 116 | ApiQueryBase::addTitleInfo( $entry, $title ); |
119 | 117 | } |
120 | | - if( $fld_action ) |
| 118 | + if ( $fld_action ) |
121 | 119 | $entry['action'] = $row->afl_action; |
122 | | - if( $fld_result ) |
| 120 | + if ( $fld_result ) |
123 | 121 | $entry['result'] = $row->afl_actions; |
124 | | - if( $fld_timestamp ) |
| 122 | + if ( $fld_timestamp ) |
125 | 123 | $entry['timestamp'] = wfTimestamp( TS_ISO_8601, $row->afl_timestamp ); |
126 | | - if( $fld_details ) { |
| 124 | + if ( $fld_details ) { |
127 | 125 | $vars = AbuseFilter::loadVarDump( $row->afl_var_dump ); |
128 | 126 | if ( $vars instanceof AbuseFilterVariableHolder ) { |
129 | 127 | $entry['details'] = $vars->exportAllVars(); |
— | — | @@ -132,7 +130,7 @@ |
133 | 131 | } |
134 | 132 | if ( $entry ) { |
135 | 133 | $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $entry ); |
136 | | - if( !$fit ) { |
| 134 | + if ( !$fit ) { |
137 | 135 | $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->afl_timestamp ) ); |
138 | 136 | break; |
139 | 137 | } |
— | — | @@ -182,7 +180,7 @@ |
183 | 181 | ApiBase::PARAM_ISMULTI => true |
184 | 182 | ) |
185 | 183 | ); |
186 | | - } |
| 184 | + } |
187 | 185 | |
188 | 186 | public function getParamDescription() { |
189 | 187 | return array( |
— | — | @@ -191,7 +189,7 @@ |
192 | 190 | 'dir' => 'The direction in which to enumerate', |
193 | 191 | 'title' => 'Show only entries occurring on a given page.', |
194 | 192 | 'user' => 'Show only entries done by a given user or IP address.', |
195 | | - 'filter' => 'Show only entries that were caught by a given filter ID', |
| 193 | + 'filter' => 'Show only entries that were caught by a given filter ID', |
196 | 194 | 'limit' => 'The maximum amount of entries to list', |
197 | 195 | 'prop' => 'Which properties to get', |
198 | 196 | ); |
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | 'abusefilter-edit-builder-vars-old-html' => 'Old page wikitext, parsed into HTML', |
317 | 317 | 'abusefilter-edit-builder-vars-minor-edit' => 'Whether or not the edit is marked as minor', |
318 | 318 | 'abusefilter-edit-builder-vars-file-sha1' => 'SHA1 hash of file contents', |
319 | | - |
| 319 | + |
320 | 320 | // Filter history |
321 | 321 | 'abusefilter-filter-log' => 'Recent filter changes', |
322 | 322 | 'abusefilter-history' => 'Change history for Abuse Filter #$1', |
— | — | @@ -420,7 +420,7 @@ |
421 | 421 | 'abusefilter-examine-notfound' => 'The change you requested could not be found.', |
422 | 422 | 'abusefilter-examine-incompatible' => 'The change you requested is not supported by the Abuse Filter', |
423 | 423 | 'abusefilter-examine-noresults' => 'No results were found for the search parameters you provided.', |
424 | | - |
| 424 | + |
425 | 425 | // Top navigation interface |
426 | 426 | 'abusefilter-topnav' => "'''Abuse Filter navigation'''", |
427 | 427 | 'abusefilter-topnav-home' => 'Home', |
— | — | @@ -429,13 +429,13 @@ |
430 | 430 | 'abusefilter-topnav-log' => 'Abuse Log', |
431 | 431 | 'abusefilter-topnav-tools' => 'Debugging tools', |
432 | 432 | 'abusefilter-topnav-import' => 'Import filter', |
433 | | - |
| 433 | + |
434 | 434 | // Logging |
435 | 435 | 'abusefilter-log-name' => 'Abuse Filter log', |
436 | 436 | 'abusefilter-log-header' => "This log shows a summary of changes made to filters. |
437 | 437 | For full details, see [[Special:AbuseFilter/history|the list]] of recent filter changes.", |
438 | 438 | 'abusefilter-log-entry-modify' => 'modified $1 ($2)', |
439 | | - |
| 439 | + |
440 | 440 | // Diffs |
441 | 441 | 'abusefilter-diff-title' => 'Differences between versions', |
442 | 442 | 'abusefilter-diff-item' => 'Item', |
— | — | @@ -444,7 +444,7 @@ |
445 | 445 | 'abusefilter-diff-pattern' => 'Filter conditions', |
446 | 446 | 'abusefilter-diff-invalid' => 'Unable to fetch the requested versions', |
447 | 447 | 'abusefilter-diff-backhistory' => 'Back to filter history', |
448 | | - |
| 448 | + |
449 | 449 | // Import interface |
450 | 450 | 'abusefilter-import-intro' => 'You can use this interface to import filters from other wikis. |
451 | 451 | On the source wiki, click "{{int:abusefilter-edit-export}}" under "{{int:abusefilter-tools-subtitle}}" on the editing interface. |
— | — | @@ -2055,7 +2055,7 @@ |
2056 | 2056 | 'abusefilter' => 'Настройка на защитата от вредоносни действия', |
2057 | 2057 | 'abuselog' => 'Дневник на вредоносните действия', |
2058 | 2058 | 'abusefilter-intro' => 'Добре дошли в административния интерфейс на Филтъра срещу злоупотреби. |
2059 | | -Филтърът срещу злоупотреби е автоматизиран софтуерен механизъм за прилагане на евристични оценки към разнообразни действия. |
| 2059 | +Филтърът срещу злоупотреби е автоматизиран софтуерен механизъм за прилагане на евристични оценки към разнообразни действия. |
2060 | 2060 | Този интерфейс показва списък на дефинираните филтри с възможност те да бъдат променяни.', |
2061 | 2061 | 'abusefilter-mustbeeditor' => 'От съображения за сигурност само потребители с права да променят филтрите срещу злоупотреби могат да използват този интерфейс.', |
2062 | 2062 | 'abusefilter-warning' => "<big>'''Внимание'''</big>: Извършваното действие беше автоматично разпознато като вредоносно. |
— | — | @@ -2759,8 +2759,8 @@ |
2760 | 2760 | 'abusefilter-log-search-filter' => 'Filtriraj ID:', |
2761 | 2761 | 'abusefilter-log-search-title' => 'Naslov:', |
2762 | 2762 | 'abusefilter-log-search-submit' => 'Traži', |
2763 | | - 'abusefilter-log-entry' => '$1: Korisnik $2 je pokrenuo filter za zloupotrebu, napravivši akciju "$3" na $4. |
2764 | | -Napravljena akcija: $5; |
| 2763 | + 'abusefilter-log-entry' => '$1: Korisnik $2 je pokrenuo filter za zloupotrebu, napravivši akciju "$3" na $4. |
| 2764 | +Napravljena akcija: $5; |
2765 | 2765 | Opis filtera: $6', |
2766 | 2766 | 'abusefilter-log-detailedentry-meta' => '$1: Korisnik $2 pokrenuo $3, napravivši akciju "$4" na $5. Napravljena akcija: $6; Opis filtera: $7 ($8{{int:pipe-separator}}$9)', |
2767 | 2767 | 'abusefilter-log-detailedentry-global' => 'globalni filter $1', |
— | — | @@ -3678,7 +3678,7 @@ |
3679 | 3679 | Denne grænseflade viser en liste over definerede filtre, og gør det muligt at ændre dem.', |
3680 | 3680 | 'abusefilter-mustbeeditor' => 'Af sikkerhedsmæssige årsager kan denne grænseflade kun bruges af brugere med rettigheder til at ændre misbrugsfiltre.', |
3681 | 3681 | 'abusefilter-warning' => "<big>'''Advarsel:'''</big> Denne handling er automatisk blevet identificeret som skadelig. |
3682 | | -Ikke-konstruktive redigeringer bliver hurtigt fjernet, |
| 3682 | +Ikke-konstruktive redigeringer bliver hurtigt fjernet, |
3683 | 3683 | og forstyrrende eller gentagende ikke-konstruktive redigeringer vil føre til at din konto eller computer bliver blokeret. |
3684 | 3684 | Hvis du mener at dette er en konstruktiv redigering så klik på \"Gem\" igen for at bekræfte. |
3685 | 3685 | En kortfattet beskrivelse af misbrugsreglen som din handling udløste er: \$1", |
— | — | @@ -4471,28 +4471,28 @@ |
4472 | 4472 | 'abusefilter' => 'Konfigurasyonê filitere yê abusî', |
4473 | 4473 | 'abuselog' => 'Logê abuseyî', |
4474 | 4474 | 'abusefilter-intro' => 'Îdareyê filitreyê abuseyî şima xeyr ameyî. |
4475 | | -Filitreyê abuseyî yew softwareyê otomatikî ke otomatik heuristics applikasyon keno. |
| 4475 | +Filitreyê abuseyî yew softwareyê otomatikî ke otomatik heuristics applikasyon keno. |
4476 | 4476 | Ena pele yew listeyê filitreyî mucneno u vurnayîşan rê destur dano.', |
4477 | 4477 | 'abusefilter-mustbeeditor' => 'Qe pawitişî, teyna kerberanê ke pê desturî eşkeno filitreyê abuseyî bivurne.', |
4478 | | - 'abusefilter-warning' => "<big>'''Îkaz'''</big>: Ena hereket hewl niyo u zerar dano. |
| 4478 | + 'abusefilter-warning' => "<big>'''Îkaz'''</big>: Ena hereket hewl niyo u zerar dano. |
4479 | 4479 | Ma vurnayîşanê ke zerarin lez wedarneno, |
4480 | 4480 | eyni zeman de, eka ti ser vurnayîşê xo zerarin de zaf israr kenî, ma hesab u komputerê tu blok kenî. |
4481 | 4481 | Eka ti van vurnayîşê xo konstraktif o ya zi hewl o, rena qeyd bike. |
4482 | 4482 | Yew deskripsiyonê hereketê tu zerarin: $1", |
4483 | 4483 | 'abusefilter-disallowed' => 'Ena hereket hewl niyo u zerar dano, |
4484 | | -ayra destur çini yo. |
| 4484 | +ayra destur çini yo. |
4485 | 4485 | Eka ti van vurnayîşê xo konstraktif o ya zi hewl o, yew îdare kerdoğê sîteyî rê mesaj bişirave. |
4486 | 4486 | Yew deskripsiyonê hereketê tu zerarin: $1', |
4487 | 4487 | 'abusefilter-blocked-display' => 'Ena hereket hewl niyo u zerar dano, |
4488 | 4488 | aye ra ti niekeno qeyd bike. |
4489 | | -Eyni zemun de, qe pawitişê {{SITENAME}}î hesab u IPyê tu blok biyo. |
| 4489 | +Eyni zemun de, qe pawitişê {{SITENAME}}î hesab u IPyê tu blok biyo. |
4490 | 4490 | Eka ti van ma yew ğeletî keno, yew îdare kerdoğê sîteyî rê mesaj bişirave. |
4491 | 4491 | Yew deskripsiyonê hereketê tu zerarin: $1', |
4492 | 4492 | 'abusefilter-degrouped' => 'Ena hereket hewl niyo u zerar dano. |
4493 | 4493 | Aye ra destur tu çini yo u heqanê tu yê hemî ma ti ra grewt. |
4494 | | -Eka ti van ma yew ğeletî keno, yew îdare kerdoğê sîteyî rê mesaj bişirave. Eka yew ğelet esto, ma heqanê tu yê hemî reyna dan. |
| 4494 | +Eka ti van ma yew ğeletî keno, yew îdare kerdoğê sîteyî rê mesaj bişirave. Eka yew ğelet esto, ma heqanê tu yê hemî reyna dan. |
4495 | 4495 | Yew deskripsiyonê hereketê tu zerarin: $1', |
4496 | | - 'abusefilter-autopromote-blocked' => 'Ena hereket hewl niyo u zerar dano u aye ra destur tu çini yo. |
| 4496 | + 'abusefilter-autopromote-blocked' => 'Ena hereket hewl niyo u zerar dano u aye ra destur tu çini yo. |
4497 | 4497 | Qe pawitişê sîte, heqanê tu yê nime ma ti ra grewt. |
4498 | 4498 | Yew deskripsiyonê hereketê tu zerarin: $1', |
4499 | 4499 | 'abusefilter-blocker' => 'Filitreyê abuseyî', |
— | — | @@ -4853,7 +4853,7 @@ |
4854 | 4854 | 'abusefilter-diff-invalid' => 'Nieşkenî versiyonê ke ti wazeno fetch bike', |
4855 | 4855 | 'abusefilter-diff-backhistory' => 'Tarixê filitreyî reyna şi', |
4856 | 4856 | 'abusefilter-import-intro' => 'Ti eşkeno ser ena ripel de wîkîyî binan ra filitre împort bike. |
4857 | | -Wîkî çimeyî de bine "{{int:abusefilter-tools-subtitle}}" de "{{int:abusefilter-edit-export}}" klik bike. |
| 4857 | +Wîkî çimeyî de bine "{{int:abusefilter-tools-subtitle}}" de "{{int:abusefilter-edit-export}}" klik bike. |
4858 | 4858 | Kutiyê nuştîşî kopye bike u ena kutiyê nuştîş rê na pa u klik bike "{{int:abusefilter-import-submit}}".', |
4859 | 4859 | 'abusefilter-import-submit' => 'Data împort bike', |
4860 | 4860 | ); |
— | — | @@ -7171,7 +7171,7 @@ |
7172 | 7172 | Syy: $1', |
7173 | 7173 | 'abusefilter-degrouped' => 'Tämä toimenpide on automaattisesti tunnistettu haitalliseksi. |
7174 | 7174 | Siitä johtuen sitä ei ole sallittu, ja koska käyttäjätilisi on epäilty olevan murrettu, sen kaikki oikeudet on peruttu. |
7175 | | -Mikäli tämä on ollut mielestäsi erehdys, ota yhteyttä byrokraattiin ja esitä perustelusi tälle toimenpiteelle, niin oikeutesi saatetaan palauttaa. |
| 7175 | +Mikäli tämä on ollut mielestäsi erehdys, ota yhteyttä byrokraattiin ja esitä perustelusi tälle toimenpiteelle, niin oikeutesi saatetaan palauttaa. |
7176 | 7176 | Lyhyt kuvaus väärinkäyttösuodattimen säännöstä, joka täsmää toimenpiteeseesi on: $1', |
7177 | 7177 | 'abusefilter-autopromote-blocked' => 'Tämä toimenpide on automaattisesti tunnistettu haitalliseksi, ja sitä ei ole sallittu. |
7178 | 7178 | Turvallisuussyistä jotkin rutiininomaisesti peruskäyttäjille myönnetyt etuoikeudet on väliaikaisesti poistettu käyttäjätunnukseltasi. |
— | — | @@ -7204,10 +7204,10 @@ |
7205 | 7205 | 'abusefilter-log-search-filter' => 'Tunniste', |
7206 | 7206 | 'abusefilter-log-search-title' => 'Otsikko:', |
7207 | 7207 | 'abusefilter-log-search-submit' => 'Etsi', |
7208 | | - 'abusefilter-log-entry' => '$1: $2 laukaisi väärinkäyttösuodattimen käyttäessään toimintoa ”$3” osoitteessa $4. |
| 7208 | + 'abusefilter-log-entry' => '$1: $2 laukaisi väärinkäyttösuodattimen käyttäessään toimintoa ”$3” osoitteessa $4. |
7209 | 7209 | Laukaistut toiminnot: $5 |
7210 | 7210 | Suodattimen kuvaus: $6', |
7211 | | - 'abusefilter-log-detailedentry-meta' => '$1: $2 laukaisi suodattimen $3 käyttäessään toimintoa ”$4” osoitteessa $5. |
| 7211 | + 'abusefilter-log-detailedentry-meta' => '$1: $2 laukaisi suodattimen $3 käyttäessään toimintoa ”$4” osoitteessa $5. |
7212 | 7212 | Laukaistut toiminnot: $6 |
7213 | 7213 | Suodattimen kuvaus: $7 ($8{{int:pipe-separator}}$9)', |
7214 | 7214 | 'abusefilter-log-detailedentry-local' => 'suodatin $1', |
— | — | @@ -7266,8 +7266,8 @@ |
7267 | 7267 | 'abusefilter-reautoconfirm-done' => 'Tunnuksen automaattisesti hyväksytyn tila on palautettu', |
7268 | 7268 | 'abusefilter-status' => 'Viimeisestä $1 {{PLURAL:$1|toiminnosta|toiminnosta}}, $2 ($3 %) {{PLURAL:$2|saavutti|saavutti}} ehtorajan $4, ja $5 ($6 %) {{PLURAL:$5|täsmäsi|täsmäsi}} yhteen nyt käytössä olevista suodattimista.', |
7269 | 7269 | 'abusefilter-edit-subtitle' => 'Muokataan suodatinta $1', |
7270 | | - 'abusefilter-edit-oldwarning' => '<strong>Muokkaat tämän suodattimen vanhaa versiota. |
7271 | | -Annetut tilastot ovat suodattimen uusimmalle versiolle. |
| 7270 | + 'abusefilter-edit-oldwarning' => '<strong>Muokkaat tämän suodattimen vanhaa versiota. |
| 7271 | +Annetut tilastot ovat suodattimen uusimmalle versiolle. |
7272 | 7272 | Jos tallennat muutoksesi, yliajat kaikki muokkaamasi version jälkeen tehdyt muutokset.</strong> • |
7273 | 7273 | [[Special:AbuseFilter/history/$2|Palaa suodattimen historiaan]].', |
7274 | 7274 | 'abusefilter-edit-status-label' => 'Tilastot:', |
— | — | @@ -7317,7 +7317,7 @@ |
7318 | 7318 | 'abusefilter-edit-done' => 'Muutokset suodattimeen $1 tallennettiin onnistuneesti.', |
7319 | 7319 | 'abusefilter-edit-badsyntax' => 'Suodattimessa, jonka määritit on syntaksivirhe. |
7320 | 7320 | Jäsentimen palaute: <pre>$1</pre>', |
7321 | | - 'abusefilter-edit-restricted' => 'Et voi muuttaa tätä suodatinta, koska se sisältää yhden tai useamman rajoitetun toiminnon. |
| 7321 | + 'abusefilter-edit-restricted' => 'Et voi muuttaa tätä suodatinta, koska se sisältää yhden tai useamman rajoitetun toiminnon. |
7322 | 7322 | Pyydä rajoitettujen toimintojen lisäämiseen tarvittavien oikeuksien haltijalta, että tämä tekee muutoksen puolestasi.', |
7323 | 7323 | 'abusefilter-edit-viewhistory' => 'Näytä suodattimen historia', |
7324 | 7324 | 'abusefilter-edit-history' => 'Historia', |
— | — | @@ -7481,7 +7481,7 @@ |
7482 | 7482 | Annettu syy: $2', |
7483 | 7483 | 'abusefilter-revert-reasonfield' => 'Palautuksen syy', |
7484 | 7484 | 'abusefilter-test' => 'Kokeile suodatinta viimeisimpiin muokkauksiin', |
7485 | | - 'abusefilter-test-intro' => 'Tämä sivu antaa sinun tarkistaa alla olevaan kenttään syötetyn suodattimen viimeistä $1 {{PLURAL:$1|muutosta|muutosta}} vasten. |
| 7485 | + 'abusefilter-test-intro' => 'Tämä sivu antaa sinun tarkistaa alla olevaan kenttään syötetyn suodattimen viimeistä $1 {{PLURAL:$1|muutosta|muutosta}} vasten. |
7486 | 7486 | Ladataksesi olemassa olevan suodattimen, kirjoita sen tunniste tekstikentän alapuolella olevaan kenttään ja napsauta ”Lataa”-painiketta.', |
7487 | 7487 | 'abusefilter-test-legend' => 'Suodattimen kokeilu', |
7488 | 7488 | 'abusefilter-test-load-filter' => 'Lataa suodatin tunnisteella:', |
— | — | @@ -8430,7 +8430,7 @@ |
8431 | 8431 | 'abusefilter-edit-subtitle' => 'Editando o filtro $1', |
8432 | 8432 | 'abusefilter-edit-oldwarning' => '<strong>Está a editar unha versión vella deste filtro. |
8433 | 8433 | As estatísticas citadas son da versión máis recente do filtro. |
8434 | | -Se garda os seus cambios, sobrescribirá todos os cambios desde a revisión que está editando.</strong> • |
| 8434 | +Se garda os seus cambios, sobrescribirá todos os cambios desde a revisión que está editando.</strong> • |
8435 | 8435 | [[Special:AbuseFilter/history/$2|Voltar ao historial deste filtro]]', |
8436 | 8436 | 'abusefilter-edit-status-label' => 'Estatísticas:', |
8437 | 8437 | 'abusefilter-edit-status' => '{{PLURAL:$1|Da última acción|Das $1 últimas accións}}, este filtro coincidiu con $2 ($3%). |
— | — | @@ -9125,7 +9125,7 @@ |
9126 | 9126 | 'abusefilter-revert-periodend' => 'Änd vum Zytruum:', |
9127 | 9127 | 'abusefilter-revert-search' => 'Wehl Aktione uus', |
9128 | 9128 | 'abusefilter-revert-filter' => 'Filter:', |
9129 | | - 'abusefilter-revert-preview-intro' => 'Do unte sin d Aktion vum Missbruuchfilter, wu dur die Aktion zrugggsetzt wäre. |
| 9129 | + 'abusefilter-revert-preview-intro' => 'Do unte sin d Aktion vum Missbruuchfilter, wu dur die Aktion zrugggsetzt wäre. |
9130 | 9130 | Bitte prief si sorgfältig un druck "Bstätige" go Dyyni Uuswahl bstätige.', |
9131 | 9131 | 'abusefilter-revert-confirm' => 'Bstätige', |
9132 | 9132 | 'abusefilter-revert-success' => 'Du hesch alli Aktionen zrugggsetzt, wu vum Missbruuchsfilter mgacht wore sin wäg em [[Special:AbuseFilter/$1|Filter $1]].', |
— | — | @@ -9282,7 +9282,7 @@ |
9283 | 9283 | 'abusefilter-log-search-title' => 'כותרת:', |
9284 | 9284 | 'abusefilter-log-search-submit' => 'חיפוש', |
9285 | 9285 | 'abusefilter-log-entry' => '$1: $2 הפעיל את מסנן ההשחתות כשביצע את הפעולה $3 על $4. |
9286 | | -פעולות שננקטו: $5; |
| 9286 | +פעולות שננקטו: $5; |
9287 | 9287 | תיאור המסנן: $6', |
9288 | 9288 | 'abusefilter-log-detailedentry-meta' => '$1: $2 הפעיל את $3 כשביצע את הפעולה "$4" על $5. |
9289 | 9289 | הפעולות שננקטו: $6; |
— | — | @@ -9679,7 +9679,7 @@ |
9680 | 9680 | 'abusefilter-log-entry' => '$1: $2 pokrenuo je filtar zloporabe, vršeći radnju "$3" na $4. |
9681 | 9681 | Poduzete radnje: $5; |
9682 | 9682 | Opis filtra: $6', |
9683 | | - 'abusefilter-log-detailedentry-meta' => '$1: $2 pokrenuo je $3, vršeći radnju "$4" na $5. |
| 9683 | + 'abusefilter-log-detailedentry-meta' => '$1: $2 pokrenuo je $3, vršeći radnju "$4" na $5. |
9684 | 9684 | Poduzete radnje: $6; |
9685 | 9685 | Opis filtra: $7 ($8{{int:pipe-separator}}$9)', |
9686 | 9686 | 'abusefilter-log-detailedentry-local' => 'filtar $1', |
— | — | @@ -9858,11 +9858,11 @@ |
9859 | 9859 | 'abusefilter-revert-filter' => 'Filtar:', |
9860 | 9860 | 'abusefilter-revert-confirm' => 'Potvrdi', |
9861 | 9861 | 'abusefilter-revert-success' => 'Vratili ste radnje poduzete od strane filtra zloporabe tijekom [[Special:AbuseFilter/$1|filtriranja $1]].', |
9862 | | - 'abusefilter-revert-reason' => 'Automatsko vraćanje svih radnji poduzetih od strane filtra zloporabe tijekom filtriranja $1. |
| 9862 | + 'abusefilter-revert-reason' => 'Automatsko vraćanje svih radnji poduzetih od strane filtra zloporabe tijekom filtriranja $1. |
9863 | 9863 | Razlog dan: $2', |
9864 | 9864 | 'abusefilter-revert-reasonfield' => 'Razlog za vraćanje:', |
9865 | 9865 | 'abusefilter-test' => 'Testiraj filtar s prethodnim uređivanjem', |
9866 | | - 'abusefilter-test-intro' => 'Ova stranica omogućava provjeru filtra unešenog u donji okvir sa zadnjom $ 1 {{PLURAL:$1|promjenom|promjenama}}. |
| 9866 | + 'abusefilter-test-intro' => 'Ova stranica omogućava provjeru filtra unešenog u donji okvir sa zadnjom $ 1 {{PLURAL:$1|promjenom|promjenama}}. |
9867 | 9867 | Za učitavanje postojećeg filtra, upišite ID filtra u okvir ispod okvira za uređenjivanje i kliknite tipku "Učitaj".', |
9868 | 9868 | 'abusefilter-test-legend' => 'Testiranje filtra', |
9869 | 9869 | 'abusefilter-test-load-filter' => 'Učitaj ID filtra:', |
— | — | @@ -10319,16 +10319,16 @@ |
10320 | 10320 | nem hajtható végre. |
10321 | 10321 | Ha úgy gondolod, hogy a szerkesztésed építő jellegű, lépj kapcsolatba egy adminisztrátorral, és jelezd neki, hogy mit szerettél volna csinálni. |
10322 | 10322 | A visszaélési szabály rövid leírása, amelynek az általad végzett művelet megfelelt: $1', |
10323 | | - 'abusefilter-blocked-display' => 'Ez a művelet automatikusan károsnak lett minősítve, |
| 10323 | + 'abusefilter-blocked-display' => 'Ez a művelet automatikusan károsnak lett minősítve, |
10324 | 10324 | így nem hajtható végre. |
10325 | 10325 | A(z) {{SITENAME}} védelme érdekében a szerkesztõi fiókodat és az összes hozzátartozó IP címet blokkoltuk. |
10326 | 10326 | Ha úgy gondolod, hogy a blokkolás egy rendszerhiba eredménye volt, lépj kapcsolatba egy adminisztrátorral, és jelezd neki, hogy mit szerettél volna csinálni. |
10327 | 10327 | A visszaélési szabály rövid leírása, amelynek az általad végzett művelet megfelelt: $1', |
10328 | 10328 | 'abusefilter-degrouped' => 'Ez a művelet automatikusan károsnak lett minősítve, ezért nem engedélyezzük. Mivel a felhasználói fiókodat valószínűleg ártó szándékkal használják, az összes szerkesztési jogodat felfüggesztettük. |
10329 | | -Ha szerinted ez egy rendszerhiba eredménye volt, akkor lépj kapcsolatba egy bürokratával és magyarázd el neki, hogy mi történt. |
| 10329 | +Ha szerinted ez egy rendszerhiba eredménye volt, akkor lépj kapcsolatba egy bürokratával és magyarázd el neki, hogy mi történt. |
10330 | 10330 | A bürokrata eldöntheti, hogy visszaállítsa-e a korábbi jogaidat. |
10331 | 10331 | A visszaélési szabály rövid leírása, amelynek az általad végzett művelet megfelelt: $1', |
10332 | | - 'abusefilter-autopromote-blocked' => 'Ez a művelet automatikusan károsnak lett minősítve, így nem hajtható végre. |
| 10332 | + 'abusefilter-autopromote-blocked' => 'Ez a művelet automatikusan károsnak lett minősítve, így nem hajtható végre. |
10333 | 10333 | Biztonsági okokból bizonyos jogaidat visszavontuk. |
10334 | 10334 | A visszaélési szabály rövid leírása, amelynek az általad végzett művelet megfelelt: $1', |
10335 | 10335 | 'abusefilter-blocker' => 'Vandálszűrő', |
— | — | @@ -13119,7 +13119,7 @@ |
13120 | 13120 | 'abusefilter-reautoconfirm-none' => '{{GENDER:$1|Dä|Dat|Dä Metmaacher|Dat|De}} „$1“ es bei de „{{lcfirst:{{int:group-autoconfirmed}}}}“ jeblevve.', |
13121 | 13121 | 'abusefilter-reautoconfirm-notallowed' => 'Do häs nit dat Rääsch, ene Metmaacher retuur bei de „{{int:group-autoconfirmed}}“ ze donn.', |
13122 | 13122 | 'abusefilter-reautoconfirm-done' => 'Dä Metmaacher es retuur bei de „{{int:group-autoconfirmed}}“.', |
13123 | | - 'abusefilter-status' => '{{PLURAL:$1|De letzte Akßjuhn hät|Unger de letzte $1 Akßuhne {{PLURAL:$2|hädd_er eine|hann_er $2|hät kein}}|Kein Akßuhn hät}} |
| 13123 | + 'abusefilter-status' => '{{PLURAL:$1|De letzte Akßjuhn hät|Unger de letzte $1 Akßuhne {{PLURAL:$2|hädd_er eine|hann_er $2|hät kein}}|Kein Akßuhn hät}} |
13124 | 13124 | de Jränz fun {{PLURAL:$4|ein|$4|nix}} jetroffe odder övverschredde. |
13125 | 13125 | Dat woren_er $3%. |
13126 | 13126 | {{PLURAL:$5|Ein dovun es|Dovun sinn_er $5|Keine dovun es}} vun enem aktoäll aktive Fellter jejreffe woode. |
— | — | @@ -13385,7 +13385,7 @@ |
13386 | 13386 | 'abusefilter-topnav-tools' => 'Werkzüch för Fähler ze fenge', |
13387 | 13387 | 'abusefilter-topnav-import' => 'Feltere Empotteere', |
13388 | 13388 | 'abusefilter-log-name' => 'Et Logboch övver de Meßbruchsfelter', |
13389 | | - 'abusefilter-log-header' => 'En däm Logboch he fingks De de Änderunge aan de Feltere em Övverbleck. Einzelheite sin en de |
| 13389 | + 'abusefilter-log-header' => 'En däm Logboch he fingks De de Änderunge aan de Feltere em Övverbleck. Einzelheite sin en de |
13390 | 13390 | [[Special:AbuseFilter/history|Leß met de neuste Änderunge aan Meßbruchsfeltere]].', |
13391 | 13391 | 'abusefilter-log-entry-modify' => 'hät $1 jeändert ($2)', |
13392 | 13392 | 'abusefilter-diff-title' => 'De Ungerscheide zwesche de Versione', |
— | — | @@ -13461,7 +13461,7 @@ |
13462 | 13462 | Dës Spezialsäit weist eng Lëscht vun definéierte Filteren an erlaabt et dës z'änneren.", |
13463 | 13463 | 'abusefilter-mustbeeditor' => "Aus Sécherheetsgrënn kënnen nëmme Benotzer déi d'Recht hunn fir Mëssbrauchsfilteren z'änneren dësen Interface benotzen.", |
13464 | 13464 | 'abusefilter-warning' => "<big>'''Opgepasst'''</big>: Dës Aktioun gouf automatesch als geféierlech erkannt. |
13465 | | -Ännerungen déi net konstruktiv si ginn automatesch zréckgsat, |
| 13465 | +Ännerungen déi net konstruktiv si ginn automatesch zréckgsat, |
13466 | 13466 | a besonnesch schlëmmen oder widderhuelte Fäll gëtt Äre Benotzerkont oder Computer gespaart. |
13467 | 13467 | Wann dir mengt datt Är Ännerung konstruktiv ass kënnt dir nachemol op \"Späichere\" klicken fir ze confirméieren. |
13468 | 13468 | Eng kuerz Beschreiwung vun der Mëssbrauchsregel op déi Är Aktioun reagéiert huet: \$1", |
— | — | @@ -14104,7 +14104,7 @@ |
14105 | 14105 | Controleer de truuk te dreie maotregele zorgvuldig, en klik "bevestig" óm dien selectie te bevestige.', |
14106 | 14106 | 'abusefilter-revert-confirm' => 'bevestig', |
14107 | 14107 | 'abusefilter-revert-success' => 'Doe höbs alle maotregele die door de misbroekfilter via [[Special:AbuseFilter/$1|filter $1]] zeen genomme truukgedreid.', |
14108 | | - 'abusefilter-revert-reason' => 'Autematis truukdreie van alle maotregele door de misbroekfilter via filter $1. |
| 14108 | + 'abusefilter-revert-reason' => 'Autematis truukdreie van alle maotregele door de misbroekfilter via filter $1. |
14109 | 14109 | Raej: $2', |
14110 | 14110 | 'abusefilter-revert-reasonfield' => 'Raeje veur truukdreiing:', |
14111 | 14111 | 'abusefilter-test' => "Tes 'ne filter taenge eerdere bewirkinge", |
— | — | @@ -14154,13 +14154,13 @@ |
14155 | 14155 | Jei Jūs manote, kad šis pakeitimas yra konstruktyvus, tai patvirtindami, Jūs galite pakartotinai paspausti butoną \"Išsaugoti\". |
14156 | 14156 | Trumpas aprašymas piktnaudžiavimo taisyklės, kurią Jūsų veiksmas atitinka, yra: \$1", |
14157 | 14157 | 'abusefilter-disallowed' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
14158 | | -Jei Jūs galvojate, kad Jūsų pakeitimas buvo konstruktyvus, prašome susisiekti su administratoriumi ir informuoti jį apie tai ką Jūs bandėte daryti. |
| 14158 | +Jei Jūs galvojate, kad Jūsų pakeitimas buvo konstruktyvus, prašome susisiekti su administratoriumi ir informuoti jį apie tai ką Jūs bandėte daryti. |
14159 | 14159 | Trumpas aprašymas piktnaudžiavimo taisyklės, kurią Jūsų veiksmas atitinka, yra: $1', |
14160 | | - 'abusefilter-blocked-display' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
| 14160 | + 'abusefilter-blocked-display' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
14161 | 14161 | Papildomai, apsaugant {{SITENAME}}, Jūsų naudotojo sąskaita ir visi atitinkami IP adresai buvo blokuoti pakeitimų atlikimui. |
14162 | | -Jei tai įvyko per klaidą, prašome susisiekti su administratoriumi. |
| 14162 | +Jei tai įvyko per klaidą, prašome susisiekti su administratoriumi. |
14163 | 14163 | Trumpas aprašymas piktnaudžiavimo taisyklės, kurią Jūsų veiksmas atitinka, yra: $1', |
14164 | | - 'abusefilter-degrouped' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
| 14164 | + 'abusefilter-degrouped' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
14165 | 14165 | Papildomai, kadangi susikompromitavo Jūsų naudotojo sąskaita, visos teisės buvo atimtos. Jei Jūs galvojate, kad tai įvyko per klaidą, prašome susisiekti su biurokratu, paaiškindami šią situaciją, tuomet Jūsų teisė bus atstatytos. Trumpas aprašymas piktnaudžiavimo taisyklės, kurią Jūsų veiksmas atitiko, yra: $1', |
14166 | 14166 | 'abusefilter-autopromote-blocked' => 'Šis veiksmas buvo automatiškai identifikuotas kaip kenksmingas ir todėl jis buvo neleistas įvykdyti. |
14167 | 14167 | Papildomai, saugumo tikslais, Jūsų naudotojo sąskaitai leidžiamos privilegijuotos galimybės laikinai buvo panaikintos. |
— | — | @@ -14197,8 +14197,8 @@ |
14198 | 14198 | 'abusefilter-log-entry' => '$1: $2 iššaukė piktnaudžiavimo filtrą, atlikdamas veiksmą "$3" puslapiui $4. |
14199 | 14199 | Buvo panaudotas veiksmas: $5; |
14200 | 14200 | Filtro aprašymas: $6', |
14201 | | - 'abusefilter-log-detailedentry-meta' => '$1: $2 iššaukė piktnaudžiavimo filtrą $3, atlikdamas veiksmą "$4" puslapiui $5. |
14202 | | -Buvo panaudotas veiksmas: $6; |
| 14201 | + 'abusefilter-log-detailedentry-meta' => '$1: $2 iššaukė piktnaudžiavimo filtrą $3, atlikdamas veiksmą "$4" puslapiui $5. |
| 14202 | +Buvo panaudotas veiksmas: $6; |
14203 | 14203 | Filtro aprašymas: $7 ($8{{int:pipe-separator}}$9)', |
14204 | 14204 | 'abusefilter-log-detailedentry-global' => 'visuotinis filtras $1', |
14205 | 14205 | 'abusefilter-log-detailedentry-local' => 'filtras $1', |
— | — | @@ -15490,7 +15490,7 @@ |
15491 | 15491 | Wenn du meenst, dat dor en Fehler passeert is, denn kannst du en Bürokraat schrieven un em de Saak verkloren. He kann di dien Brukerrechten weddergeven, wenn de Filter verkehrt legen hett. |
15492 | 15492 | Dor liggt dat an, dat de Filter meckert: $1', |
15493 | 15493 | 'abusefilter-autopromote-blocked' => 'Diene Akschoon is dör en automaatschen Filter as negativ kennt worrn un is nich verlöövt. |
15494 | | -Ut Sekerheitsgrünn sünd dorüm ok en poor vun de Brukerrechten intagen worrn, de Brukers kriegt, de länger dorbi sünd, un dien Brukerkonto warrt nu för en Tied eerst wedder so behannelt, as wenn du frisch dorbi büst. |
| 15494 | +Ut Sekerheitsgrünn sünd dorüm ok en poor vun de Brukerrechten intagen worrn, de Brukers kriegt, de länger dorbi sünd, un dien Brukerkonto warrt nu för en Tied eerst wedder so behannelt, as wenn du frisch dorbi büst. |
15495 | 15495 | Dor liggt dat an, dat de Filter meckert: $1', |
15496 | 15496 | 'abusefilter-blocker' => 'Missbruuk-Filter', |
15497 | 15497 | 'abusefilter-blockreason' => 'Du büst dör en Missbruukfilter automaatsch sperrt worrn. |
— | — | @@ -16681,11 +16681,11 @@ |
16682 | 16682 | 'abusefilter-log-search-filter' => 'Filter-ID:', |
16683 | 16683 | 'abusefilter-log-search-title' => 'Tittel:', |
16684 | 16684 | 'abusefilter-log-search-submit' => 'Søk', |
16685 | | - 'abusefilter-log-entry' => '$1: $2 utløste misbruksfilteret ved å gjøre en $3 på $4. |
16686 | | -Reaksjon: $5; |
| 16685 | + 'abusefilter-log-entry' => '$1: $2 utløste misbruksfilteret ved å gjøre en $3 på $4. |
| 16686 | +Reaksjon: $5; |
16687 | 16687 | filterbeskrivelse: $6', |
16688 | | - 'abusefilter-log-detailedentry-meta' => '$1: $2 utløste misbruksfilter $3, ved å gjøre en $4 på $5. |
16689 | | -Reaksjon: $6; |
| 16688 | + 'abusefilter-log-detailedentry-meta' => '$1: $2 utløste misbruksfilter $3, ved å gjøre en $4 på $5. |
| 16689 | +Reaksjon: $6; |
16690 | 16690 | Filterbeskrivelse: $7 ($8{{int:pipe-separator}}$9)', |
16691 | 16691 | 'abusefilter-log-detailedentry-global' => 'globalt filter $1', |
16692 | 16692 | 'abusefilter-log-detailedentry-local' => 'filter $1', |
— | — | @@ -17083,7 +17083,7 @@ |
17084 | 17084 | Accions presas : $5 ; |
17085 | 17085 | Descripcion del filtre : $6", |
17086 | 17086 | 'abusefilter-log-detailedentry-meta' => "$1 : $2 a desenclavat lo $3, en executant l'accion « $4 » sur $5. |
17087 | | -Accions presas : $6 ; |
| 17087 | +Accions presas : $6 ; |
17088 | 17088 | Descripcion del filtre : $7 ($8{{int:pipe-separator}}$9)", |
17089 | 17089 | 'abusefilter-log-detailedentry-global' => 'filtre global $1', |
17090 | 17090 | 'abusefilter-log-detailedentry-local' => 'filtre $1 dels abuses', |
— | — | @@ -17490,7 +17490,7 @@ |
17491 | 17491 | Interfejs pozwala przeglądać listę zdefiniowanych filtrów oraz pozwala na ich modyfikowanie.', |
17492 | 17492 | 'abusefilter-mustbeeditor' => 'Ze względów bezpieczeństwa z tego interfejsu mogą korzystać wyłącznie użytkownicy posiadający uprawnienie do zmieniania filtrów nadużyć.', |
17493 | 17493 | 'abusefilter-warning' => "<big>'''Uwaga'''</big>: Twoja edycja została automatycznie zidentyfikowana jako szkodliwa. |
17494 | | -Niewłaściwe zmiany zostaną szybko wycofane, |
| 17494 | +Niewłaściwe zmiany zostaną szybko wycofane, |
17495 | 17495 | a rażące lub powtarzające się niekonstruktywne edytowanie może spowodować zablokowanie Twojego konta lub adresu IP. |
17496 | 17496 | Jeśli uważasz, że to co robisz ma uzasadnienie, kliknij przycisk „{{int:savearticle}}”, aby zatwierdzić zmiany. |
17497 | 17497 | Krótki opis reguły nadużycia, do której Twoja akcji została dopasowana — $1", |
— | — | @@ -17537,7 +17537,7 @@ |
17538 | 17538 | 'abusefilter-log-search-filter' => 'ID filtru:', |
17539 | 17539 | 'abusefilter-log-search-title' => 'Tytuł strony', |
17540 | 17540 | 'abusefilter-log-search-submit' => 'Szukaj', |
17541 | | - 'abusefilter-log-entry' => '$1: $2 uruchomił filtr nadużyć, wykonał „$3” na $4. |
| 17541 | + 'abusefilter-log-entry' => '$1: $2 uruchomił filtr nadużyć, wykonał „$3” na $4. |
17542 | 17542 | Podjęta akcja: $5. |
17543 | 17543 | Opis filtru: $6', |
17544 | 17544 | 'abusefilter-log-detailedentry-meta' => '$1: $2 uruchomił $3, wykonał „$4” na $5. |
— | — | @@ -19265,12 +19265,12 @@ |
19266 | 19266 | Эн оҥорбут дьайыыгын кытта ситимнэммит аһара түһүү кылгас ис хоһооно: \$1", |
19267 | 19267 | 'abusefilter-disallowed' => 'Бу дьайыы апатамаатынан омсолоох курдук бэлиэтэммит, |
19268 | 19268 | онон бобуллубут. |
19269 | | -Ол гынан баран, эн туһалаах көннөрүүнү оҥордум диэн эрэнэр буоллаххына, дьаһабылга тахсан тугу гынаары гынаргын кэпсээ. |
| 19269 | +Ол гынан баран, эн туһалаах көннөрүүнү оҥордум диэн эрэнэр буоллаххына, дьаһабылга тахсан тугу гынаары гынаргын кэпсээ. |
19270 | 19270 | Эн оҥорбут дьайыыгын кытта ситимнэммит аһара түһүү кылгас ис хоһооно: $1', |
19271 | 19271 | 'abusefilter-blocked-display' => 'Бу дьайыы апатамаатынан омсолоох курдук бэлиэтэммит, |
19272 | 19272 | онон оҥороруҥ бобуллубут. |
19273 | 19273 | Ону таһынан {{SITENAME}} бырайыагы көмүскүүр соруктаах эн аатыҥ уонна IP-иҥ хааччахтаннылар. |
19274 | | -Ол гынан баран, маны сыыһа дьаһал диир буоллаххына дьаһабылга таҕыс. |
| 19274 | +Ол гынан баран, маны сыыһа дьаһал диир буоллаххына дьаһабылга таҕыс. |
19275 | 19275 | Эн оҥорбут дьайыыгын кытта ситимнэммит аһара түһүү кылгас ис хоһооно: $1', |
19276 | 19276 | 'abusefilter-degrouped' => 'Бу дьайыы апатамаатынан омсолоох курдук бэлиэтэммит, |
19277 | 19277 | онон оҥороруҥ бобуллубут, аатыҥ бөрүкүтэ суох дьон тиһиктэригэр киирбит, туох баар бырааптара уһуллубут. |
— | — | @@ -19280,7 +19280,7 @@ |
19281 | 19281 | Ону таһынан бырайыагы көмүскүүр соруктаах эн ааккыттан сорох бэлиэммит аакка бэриллэр эбии бырааптар сотуллубуттар. |
19282 | 19282 | Эн оҥорбут дьайыыгын кытта ситимнэммит аһара түһүү кылгас ис хоһооно: $1', |
19283 | 19283 | 'abusefilter-blocker' => 'Омсолоох дьайыы фильтра', |
19284 | | - 'abusefilter-blockreason' => 'Омсолоох дьайыы фильтра аптамаатынан хааччахтаабыт. |
| 19284 | + 'abusefilter-blockreason' => 'Омсолоох дьайыы фильтра аптамаатынан хааччахтаабыт. |
19285 | 19285 | Сөп түбэһэр сиэр-туом маннык: $1', |
19286 | 19286 | 'abusefilter-degroupreason' => 'Омсолоох туһаныыны хааччахтыыр фильтр бырааптаргын аптамаатынан былдьаабыт. |
19287 | 19287 | Сиэр-туом маннык: $1', |
— | — | @@ -19425,7 +19425,7 @@ |
19426 | 19426 | 'abusefilter-edit-done' => '$1 сиидэҕэ уларытыы оҥорбутуҥ сөпкө бигэргэтилиннэ.', |
19427 | 19427 | 'abusefilter-edit-badsyntax' => 'Ыйыллыбыт сиидэҕэ синтаксис сыыһата булуллубут. |
19428 | 19428 | Парсер бу биллэриини таһаарда: <pre>$1</pre>', |
19429 | | - 'abusefilter-edit-restricted' => 'Бу сиидэни уларытар кыаҕыҥ суох, тоҕо диэтэххэ биир эбэтэр хас да хааччахтыыр дьайыылаах. |
| 19429 | + 'abusefilter-edit-restricted' => 'Бу сиидэни уларытар кыаҕыҥ суох, тоҕо диэтэххэ биир эбэтэр хас да хааччахтыыр дьайыылаах. |
19430 | 19430 | Бука диэн маны уларытар кыахтаах кыттааччыттан сиидэни эйиэхэ анаан уларытарыгар көрдөс.', |
19431 | 19431 | 'abusefilter-edit-viewhistory' => 'Бу сиидэ устуоруйатын көрдөр', |
19432 | 19432 | 'abusefilter-edit-history' => 'Устуоруйата:', |
— | — | @@ -20585,7 +20585,7 @@ |
20586 | 20586 | Dessutom har några av ditt kontos rättigheter tillfälligt återkallats av säkerhetsskäl. |
20587 | 20587 | En kortfattad beskrivning av missbruksregeln som din handling utlöste är: $1', |
20588 | 20588 | 'abusefilter-blocker' => 'Missbruksfilter', |
20589 | | - 'abusefilter-blockreason' => 'Automatiskt blockerad av missbruksfiltret. |
| 20589 | + 'abusefilter-blockreason' => 'Automatiskt blockerad av missbruksfiltret. |
20590 | 20590 | Beskrivning av utlöst regel: $1', |
20591 | 20591 | 'abusefilter-degroupreason' => 'Behörigheter borttagna automatisk av missbruksfilter. Regelbeskrivning: $1', |
20592 | 20592 | 'abusefilter-accountreserved' => 'Detta konto är reserverat för användning av missbruksfiltret.', |
— | — | @@ -20612,11 +20612,11 @@ |
20613 | 20613 | 'abusefilter-log-search-filter' => 'Filter-ID:', |
20614 | 20614 | 'abusefilter-log-search-title' => 'Titel:', |
20615 | 20615 | 'abusefilter-log-search-submit' => 'Sök', |
20616 | | - 'abusefilter-log-entry' => '$1: $2 utlöste ett missbruksfilter genom att göra handlingen "$3" på $4. |
20617 | | -Utförd handling: $5; |
| 20616 | + 'abusefilter-log-entry' => '$1: $2 utlöste ett missbruksfilter genom att göra handlingen "$3" på $4. |
| 20617 | +Utförd handling: $5; |
20618 | 20618 | Filterbeskrivning: $6', |
20619 | 20619 | 'abusefilter-log-detailedentry-meta' => '$1: $2 utlöste $3, genom att göra handlingen "$4" på $5. |
20620 | | -Utförd handling: $6; |
| 20620 | +Utförd handling: $6; |
20621 | 20621 | Filterbeskrivning: $7 ($8{{int:pipe-separator}}$9)', |
20622 | 20622 | 'abusefilter-log-detailedentry-global' => 'globalt filter $1', |
20623 | 20623 | 'abusefilter-log-detailedentry-local' => 'filter $1', |
— | — | @@ -21271,7 +21271,7 @@ |
21272 | 21272 | 'abusefilter-status' => 'Soňky $1 {{PLURAL:$1|hereketden|hereketden}} $2 (%$3) sanysy $4 şert çägine baryp ýetdi, $5 (%$6) sanysy bolsa häzirki açyk filtrleriň birine gabat geldi.', |
21273 | 21273 | 'abusefilter-edit-subtitle' => '$1 filtri redaktirlenýär', |
21274 | 21274 | 'abusefilter-edit-status-label' => 'Statistikalar:', |
21275 | | - 'abusefilter-edit-status' => 'Bu filtr soňky $1 {{PLURAL:$1|hereketden|hereketden}} $2 (%$3) sanysyna gabat geldi. |
| 21275 | + 'abusefilter-edit-status' => 'Bu filtr soňky $1 {{PLURAL:$1|hereketden|hereketden}} $2 (%$3) sanysyna gabat geldi. |
21276 | 21276 | Ortaça alnanda, işlän wagty $4ms, we onuň şert çägi $5 sany şerti sarp edýär.', |
21277 | 21277 | 'abusefilter-edit-throttled' => "'''Duýduryş''': Bu filtr howpsuzlyk çäresi hökmünde awtomatik ýapyldy. |
21278 | 21278 | Ol hereketleriň %$1 sanysyndan artykmaç gabat gelme çägine baryp ýetdi.", |
— | — | @@ -21497,11 +21497,11 @@ |
21498 | 21498 | Kung naganap ito dahil sa isang pagkakamali, makipag-ugnayan sa isang tagapangasiwa. |
21499 | 21499 | Isang maiksing paglalarawan ng alituntunin sa pang-aabuso na tumugma sa kilos mo ang: $1', |
21500 | 21500 | 'abusefilter-degrouped' => 'Ang kilos na ito ay kusang nakilala bilang makakapinsala. |
21501 | | -Bilang kinahinatnan, hindi ito pinahintulutan, at, dahil sa pinaghihinalaang nalantad sa kapahamakan ang kuwenta mo, pinawalan ng bisa ang lahat ng mga karapatan. |
| 21501 | +Bilang kinahinatnan, hindi ito pinahintulutan, at, dahil sa pinaghihinalaang nalantad sa kapahamakan ang kuwenta mo, pinawalan ng bisa ang lahat ng mga karapatan. |
21502 | 21502 | Kung naniniwala kang isa itong pagkakamali, makipag-ugnayan sa isang burokrato na may isang paliwanag hinggil sa kilos na ito, at maaaring maibalik sa dati ang mga karapatan mo. |
21503 | 21503 | Isang maiksing paglalarawan ng alituntunin sa pang-aabuso na tumugma sa kilos mo ang: $1', |
21504 | 21504 | 'abusefilter-autopromote-blocked' => 'Ang kilos na ito ay kusang nakilala bilang makakapinsala, at hindi ito pinahintulutan. |
21505 | | -Bilang karagdagan, bilang isang pamamaraang pangkaligtasan, pansamantalang pinawalan ng bisa ang ilang mga pribilehiyong palagiang ibinibigay sa kinikilala nang mga akawnt. |
| 21505 | +Bilang karagdagan, bilang isang pamamaraang pangkaligtasan, pansamantalang pinawalan ng bisa ang ilang mga pribilehiyong palagiang ibinibigay sa kinikilala nang mga akawnt. |
21506 | 21506 | Isang maiksing paglalarawan ng alituntunin sa pang-aabuso na tumugma sa kilos mo ang: $1', |
21507 | 21507 | 'abusefilter-blocker' => 'Pansala ng pang-aabuso', |
21508 | 21508 | 'abusefilter-blockreason' => 'Kusang hinadlangan ng pansala ng pang-aabuso. Paglalarawan ng tumugmang alituntunin: $1', |
— | — | @@ -21528,8 +21528,8 @@ |
21529 | 21529 | 'abusefilter-log-search-filter' => 'ID ng pansala:', |
21530 | 21530 | 'abusefilter-log-search-title' => 'Pamagat:', |
21531 | 21531 | 'abusefilter-log-search-submit' => 'Maghanap', |
21532 | | - 'abusefilter-log-entry' => '$1: nagpagalaw si $2 ng isang pansala ng pang-aabuso, na nagsagawa ng $3 sa $4. |
21533 | | -Mga kilos na ginawa: $5; |
| 21532 | + 'abusefilter-log-entry' => '$1: nagpagalaw si $2 ng isang pansala ng pang-aabuso, na nagsagawa ng $3 sa $4. |
| 21533 | +Mga kilos na ginawa: $5; |
21534 | 21534 | Paglalarawan ng pansala: $6', |
21535 | 21535 | 'abusefilter-log-detailedentry-meta' => '$1: nagpagalaw si $2 ng $3, na nagsagawa ng kilos na $4 sa $5. Mga kilos na ginawa: $6; Paglalarawan ng pansala: $7 ($8{{int:pipe-separator}}$9)', |
21536 | 21536 | 'abusefilter-log-detailedentry-global' => 'Pansalang pandaigdigang $1', |
— | — | @@ -21849,8 +21849,8 @@ |
21850 | 21850 | 'abusefilter-desc' => 'Değişikliklere otomatik bulucu yöntemler uygular', |
21851 | 21851 | 'abusefilter' => 'Değişiklik süzgeci yapılandırması', |
21852 | 21852 | 'abuselog' => 'Süzgeç kayıtları', |
21853 | | - 'abusefilter-intro' => 'Değişiklik Süzgeci yönetim arayüzüne hoş geldiniz. |
21854 | | -Değişiklik Süzgeci, tüm eylemlere otomatik bulucu yöntemler uygulayan otomatik bir yazılım mekanizmasıdır. |
| 21853 | + 'abusefilter-intro' => 'Değişiklik Süzgeci yönetim arayüzüne hoş geldiniz. |
| 21854 | +Değişiklik Süzgeci, tüm eylemlere otomatik bulucu yöntemler uygulayan otomatik bir yazılım mekanizmasıdır. |
21855 | 21855 | Bu arayüz, tanımlı süzgeçlerin listesini gösterir ve değiştirilmelerine olanak sağlar.', |
21856 | 21856 | 'abusefilter-mustbeeditor' => 'Güvenlik nedeniyle, bu arayüzü sadece suistimal filtrelerini değiştirme yetkisine sahip kullanıcılar kullanabilir.', |
21857 | 21857 | 'abusefilter-warning' => "<big>'''Uyarı'''</big>: Bu eylem otomatikman zararlı olarak tanımlanmıştır. |
— | — | @@ -24675,4 +24675,3 @@ |
24676 | 24676 | 'abusefilter-edit-builder-vars-movedfrom-id' => '要移動的源頁面頁面ID', |
24677 | 24677 | 'abusefilter-edit-builder-vars-movedfrom-ns' => '要移動的源名字空間', |
24678 | 24678 | ); |
24679 | | - |
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php |
— | — | @@ -3,10 +3,8 @@ |
4 | 4 | die(); |
5 | 5 | |
6 | 6 | class AbuseFilterHooks { |
7 | | - |
8 | 7 | // So far, all of the error message out-params for these hooks accept HTML. |
9 | 8 | // Hooray! |
10 | | - |
11 | 9 | public static function onEditFilterMerged( $editor, $text, &$error, $summary ) { |
12 | 10 | // Load vars |
13 | 11 | $vars = new AbuseFilterVariableHolder; |
— | — | @@ -42,7 +40,7 @@ |
43 | 41 | |
44 | 42 | $filter_result = AbuseFilter::filterAction( $vars, $editor->mTitle ); |
45 | 43 | |
46 | | - if( $filter_result !== true ){ |
| 44 | + if ( $filter_result !== true ) { |
47 | 45 | global $wgOut; |
48 | 46 | $wgOut->addHTML( $filter_result ); |
49 | 47 | $editor->showEditForm(); |
— | — | @@ -111,7 +109,7 @@ |
112 | 110 | $vars->setVar( 'ACTION', 'createaccount' ); |
113 | 111 | $vars->setVar( 'ACCOUNTNAME', $user->getName() ); |
114 | 112 | |
115 | | - $filter_result = AbuseFilter::filterAction( |
| 113 | + $filter_result = AbuseFilter::filterAction( |
116 | 114 | $vars, SpecialPage::getTitleFor( 'Userlogin' ) ); |
117 | 115 | |
118 | 116 | $message = $filter_result; |
— | — | @@ -121,17 +119,17 @@ |
122 | 120 | |
123 | 121 | public static function onRecentChangeSave( $recentChange ) { |
124 | 122 | $title = Title::makeTitle( |
125 | | - $recentChange->mAttribs['rc_namespace'], |
| 123 | + $recentChange->mAttribs['rc_namespace'], |
126 | 124 | $recentChange->mAttribs['rc_title'] |
127 | 125 | ); |
128 | | - $action = $recentChange->mAttribs['rc_log_type'] ? |
| 126 | + $action = $recentChange->mAttribs['rc_log_type'] ? |
129 | 127 | $recentChange->mAttribs['rc_log_type'] : 'edit'; |
130 | 128 | $actionID = implode( '-', array( |
131 | 129 | $title->getPrefixedText(), $recentChange->mAttribs['rc_user_text'], $action |
132 | 130 | ) ); |
133 | 131 | |
134 | | - if ( !empty( AbuseFilter::$tagsToSet[$actionID] ) |
135 | | - && count( $tags = AbuseFilter::$tagsToSet[$actionID] ) ) |
| 132 | + if ( !empty( AbuseFilter::$tagsToSet[$actionID] ) |
| 133 | + && count( $tags = AbuseFilter::$tagsToSet[$actionID] ) ) |
136 | 134 | { |
137 | 135 | ChangeTags::addTags( |
138 | 136 | $tags, |
— | — | @@ -145,19 +143,19 @@ |
146 | 144 | } |
147 | 145 | |
148 | 146 | public static function onListDefinedTags( &$emptyTags ) { |
149 | | - ## This is a pretty awful hack. |
| 147 | + # This is a pretty awful hack. |
150 | 148 | $dbr = wfGetDB( DB_SLAVE ); |
151 | 149 | |
152 | 150 | $res = $dbr->select( |
153 | 151 | array( 'abuse_filter_action', 'abuse_filter' ), |
154 | | - 'afa_parameters', |
| 152 | + 'afa_parameters', |
155 | 153 | array( 'afa_consequence' => 'tag', 'af_enabled' => true ), |
156 | 154 | __METHOD__, |
157 | 155 | array(), |
158 | 156 | array( 'abuse_filter' => array( 'INNER JOIN', 'afa_filter=af_id' ) ) |
159 | 157 | ); |
160 | 158 | |
161 | | - while( $row = $res->fetchObject() ) { |
| 159 | + while ( $row = $res->fetchObject() ) { |
162 | 160 | $emptyTags = array_filter( |
163 | 161 | array_merge( explode( "\n", $row->afa_parameters ), $emptyTags ) |
164 | 162 | ); |
— | — | @@ -172,7 +170,7 @@ |
173 | 171 | $dir = dirname( __FILE__ ); |
174 | 172 | |
175 | 173 | // DB updates |
176 | | - if( $wgDBtype == 'mysql' ) { |
| 174 | + if ( $wgDBtype == 'mysql' ) { |
177 | 175 | $wgExtNewTables[] = array( 'abuse_filter', "$dir/abusefilter.tables.sql" ); |
178 | 176 | $wgExtNewTables[] = array( 'abuse_filter_history', "$dir/db_patches/patch-abuse_filter_history.sql" ); |
179 | 177 | $wgExtNewFields[] = array( 'abuse_filter_history', 'afh_changed_fields', "$dir/db_patches/patch-afh_changed_fields.sql" ); |
— | — | @@ -201,7 +199,7 @@ |
202 | 200 | public static function onContributionsToolLinks( $id, $nt, &$tools ) { |
203 | 201 | global $wgUser; |
204 | 202 | wfLoadExtensionMessages( 'AbuseFilter' ); |
205 | | - if( $wgUser->isAllowed( 'abusefilter-log' ) ) { |
| 203 | + if ( $wgUser->isAllowed( 'abusefilter-log' ) ) { |
206 | 204 | $sk = $wgUser->getSkin(); |
207 | 205 | $tools[] = $sk->link( |
208 | 206 | SpecialPage::getTitleFor( 'AbuseLog' ), |
Index: trunk/extensions/AbuseFilter/phpTest.php |
— | — | @@ -1,5 +1,4 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Runs tests against the PHP parser. |
6 | 5 | */ |
— | — | @@ -18,8 +17,8 @@ |
19 | 18 | $check = 0; |
20 | 19 | $pass = 0; |
21 | 20 | |
22 | | -foreach( $tests as $test ) { |
23 | | - $result = substr( $test, 0, -2 ) . ".r"; |
| 21 | +foreach ( $tests as $test ) { |
| 22 | + $result = substr( $test, 0, - 2 ) . ".r"; |
24 | 23 | |
25 | 24 | $rule = trim( file_get_contents( $test ) ); |
26 | 25 | $output = ( $cont = trim( file_get_contents( $result ) ) ) == 'MATCH'; |