User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
User:松/Drafts/Extension:AbuseFilter/Rules format (view source)
Revision as of 07:38, 1 August 2020
, 3 years agoTranslation code removal
(Translation code removal) |
(Translation code removal) |
||
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 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>.
*
*
▲* <tvar|1><code>==</code></> (or <tvar|2><code>=</code></>), <tvar|3><code>!=</code></> — Return true if the left-hand operand is ''equal to/not equal to'' the right-hand operand respectively.</translate>
▲* <tvar|1><code>===</code>{{int|comma-separator}}<code>!==</code></> — Return true if the left-hand operand is ''equal to/not equal to'' the right-hand operand AND the left-hand operand is ''the same/not the same'' data type to the right-hand operand respectively.</translate>
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-comparisons.t -->
{| class="wikitable"
! style="width: 50%;"|
! Result
|-
|<code>1 == 2</code>|| false
Line 215 ⟶ 211:
|-
|<code>['1'] == '1'</code>
|false<ref>
|}
▲== Built-in variables == <!--T:55-->
The abuse filter passes various variables by name into the parser.These variables can be accessed by typing their name in, in a place where a literal would work.
▲These variables can be accessed by typing their name in, in a place where a literal would work.</translate>
===Variables from AbuseFilter===
▲====Variables always available==== <!--T:60-->
{{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>}}
|