User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
User:松/Drafts/Extension:AbuseFilter/Rules format (view source)
Revision as of 15:03, 1 August 2020
, 3 years agono edit summary
(Translation code removal) |
No edit summary |
||
Line 559:
|}
=== Notes === <!--T:264-->▼
When
<translate>
<!--T:266-->
Line 594 ⟶ 593:
{{anchor|Performance}}
=== Performance === <!--T:275-->▼
As noted in the table above, some of these variables can be very slow.
<translate>
<!--T:277-->
Line 623 ⟶ 621:
<!--T:285-->
* In general, when dealing with these variables, it's always much better to consume further conditions but avoid computing heavy stuff.</translate> <translate><!--T:286--> In order to achieve this, always put heavy variables as last conditions.</translate>
<translate><!--T:287--> Last but not least, note that whenever a variable is computed for a given filter, it'll be saved and any other filter will immediately retrieve it.</translate>This
▲== Keywords == <!--T:289-->
{{note|1=<translate><!--T:290--> Where not specifically stated, keywords cast their operands to strings</translate>}}
<translate>
Line 692 ⟶ 689:
|}
▲== Functions == <!--T:306-->
A number of built-in functions are included to ease some common issues.They are executed in the general format
▲They are executed in the general format <tvar|1><code>functionName( arg1, arg2, arg3 )</code></>, and can be used in place of any literal or variable.</translate>
{| class="wikitable sortable"
Line 767 ⟶ 755:
|}
▲=== Examples === <!--T:364-->
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-functions.t -->
{| class="wikitable"
Line 861 ⟶ 848:
|}
▲== Order of operations == <!--T:370-->
Operations are generally done left-to-right, but there is an order to which they are resolved.
▲Operations are generally done left-to-right, but there is an order to which they are resolved.</translate>
<translate>
<!--T:372-->
Line 886 ⟶ 871:
# <translate><!--T:384--> Boolean operations.</translate> (<code>&</code>, <code>|</code>, <code>^</code>)
▲=== Examples === <!--T:385-->
* <translate><!--T:386--> <tvar|1><code>A & B | C</code></> is equivalent to <tvar|2><code>(A & B) | C</code></>, not to <tvar|3><code>A & (B | C)</code></>.</translate> <translate><!--T:387--> In particular, both <tvar|1><code>false & true '''| true'''</code></> and <tvar|2><code>false & false '''| true'''</code></> evaluates to <tvar|3><code>true</code></>.</translate>
* <translate><!--T:388--> <tvar|1><code>A | B & C</code></> is equivalent to <tvar|2><code>(A | B) & C</code></>, not to <tvar|3><code>A | (B & C)</code></>.</translate> <translate><!--T:389--> In particular, both <tvar|1><code>true | true '''& false'''</code></> and <tvar|2><code>true | false '''& false'''</code></> evaluates to <tvar|3><code>false</code></>.</translate>
|