Jump to content

User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions

Translation code removal
(Translation code removal)
(Translation code removal)
Line 158:
* <code>&lt;</code>{{int|comma-separator}}<code>&gt;</code> &mdash; 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>&lt;=</code>{{int|comma-separator}}<code>&gt;=</code> &mdash; 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></> &mdash; Return true if the left-hand operand is ''equal to/not equal to'' the right-hand operand respectively.</translate>
<translate>
* <tvar|1><code>===</code>{{int|comma-separator}}<code>!==</code></> &mdash; 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>
<!--T:50-->
* <tvar|1><code>==</code></> (or <tvar|2><code>=</code></>), <tvar|3><code>!=</code></> &mdash; Return true if the left-hand operand is ''equal to/not equal to'' the right-hand operand respectively.</translate>
<translate>
<!--T:51-->
* <tvar|1><code>===</code>{{int|comma-separator}}<code>!==</code></> &mdash; 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%;"| <translate><!--T:52--> Example</translate>
! Result
! <translate><!--T:53--> Result</translate>
|-
|<code>1 == 2</code>|| false
Line 215 ⟶ 211:
|-
|<code>['1'] == '1'</code>
|false<ref><translate><!--T:54--> Comparing arrays to other types will always return false, except for the example above</translate></ref>
|}
 
== Built-in variables  == <!--T:55-->
<translate>
== 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.</translate>You can view the variables associated with each request in the abuse log.
<!--T:56-->
The abuse filter passes various variables by name into the parser.</translate>
<translate>
<!--T:57-->
These variables can be accessed by typing their name in, in a place where a literal would work.</translate>
<translate>
<!--T:58-->
You can view the variables associated with each request in the abuse log.
 
===Variables from AbuseFilter=== <!--T:59-->
 
====Variables always available==== <!--T:60-->
 
====Variables always available==== <!--T:60-->
</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>}}
 
222

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.