User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
Content added Content deleted
(Translation code removal) |
(Translation code removal) |
||
Line 158: | Line 158: | ||
* <code><</code>{{int|comma-separator}}<code>></code> — Return true if the left-hand [[w:Operand|operand]] is ''less than/greater than'' the right-hand operand respectively. Watch out: operands are casted to strings and, like it happens in PHP, <code>null < any number === true</code> and <code>null > any number === false</code>. |
* <code><</code>{{int|comma-separator}}<code>></code> — Return true if the left-hand [[w:Operand|operand]] is ''less than/greater than'' the right-hand operand respectively. Watch out: operands are casted to strings and, like it happens in PHP, <code>null < any number === true</code> and <code>null > any number === false</code>. |
||
* <code><=</code>{{int|comma-separator}}<code>>=</code> — Return true if the left-hand operand is ''less than or equal to/greater than or equal to'' the right-hand operand respectively.Watch out: operands are casted to strings and, like it happens in PHP, <code>null <= any number === true</code> and <code>null >= any number === false</code>. |
* <code><=</code>{{int|comma-separator}}<code>>=</code> — Return true if the left-hand operand is ''less than or equal to/greater than or equal to'' the right-hand operand respectively.Watch out: operands are casted to strings and, like it happens in PHP, <code>null <= any number === true</code> and <code>null >= any number === false</code>. |
||
⚫ | |||
<translate> |
|||
⚫ | |||
<!--T:50--> |
|||
⚫ | |||
<translate> |
|||
<!--T:51--> |
|||
⚫ | |||
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-comparisons.t --> |
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-comparisons.t --> |
||
{| class="wikitable" |
{| class="wikitable" |
||
! style="width: 50%;"| |
! style="width: 50%;"| Example |
||
! Result |
|||
! <translate><!--T:53--> Result</translate> |
|||
|- |
|- |
||
|<code>1 == 2</code>|| false |
|<code>1 == 2</code>|| false |
||
Line 215: | Line 211: | ||
|- |
|- |
||
|<code>['1'] == '1'</code> |
|<code>['1'] == '1'</code> |
||
|false<ref> |
|false<ref>Comparing arrays to other types will always return false, except for the example above</ref> |
||
|} |
|} |
||
⚫ | |||
<translate> |
|||
⚫ | |||
⚫ | |||
<!--T:56--> |
|||
The abuse filter passes various variables by name into the parser.</translate> |
|||
<translate> |
|||
<!--T:57--> |
|||
⚫ | |||
<translate> |
|||
<!--T:58--> |
|||
You can view the variables associated with each request in the abuse log. |
|||
===Variables from AbuseFilter=== |
===Variables from AbuseFilter=== |
||
⚫ | |||
⚫ | |||
</translate> |
|||
{{Caution|1=<translate><!--T:414--> User-related variables are always available, except for one case: account creation when the creator is not logged in.</translate> <translate><!--T:415--> All variables starting with <tvar|1><code>user_</code></> are affected.</translate>}} |
{{Caution|1=<translate><!--T:414--> User-related variables are always available, except for one case: account creation when the creator is not logged in.</translate> <translate><!--T:415--> All variables starting with <tvar|1><code>user_</code></> are affected.</translate>}} |
||