mediawiki-extensions-AbuseF.../includes
Daimona Eaytoy aa867bd370 Better handling of function params in CachingParser
This patch includes various fixes to how func arguments are handled in
CachingParser:
- Add a comment about a future improvement of checkSyntax, which we
  could limit to try building the AST.
- Having enough args for each function is now also checked when
  building the AST. This allows implementing the previous point without
  stopping to report notenoughargs at syntaxcheck-time (otherwise it'd be
  a runtime error). And it also ensure that we check for the params count
  inside skipped branches, e.g. inside if/else: these were already only
  discovered at runtime in CachingParser. The old parser is not affected
  by this change, because when checking syntax it will always execute
  all branches, and at runtime it will skip braces altogether.
- Fix arg count for CachingParser, which previously added a bogus param
  in case of a function called without parameters. This was fixed for
  the other parser in I484fe2994292970276150d2e417801453339e540, and I
  just ported the updated fix. Also note that the CachingParser was
  already failing for e.g. `count()`, but instead of complaining about
  missing arguments, it failed hard when trying to pass NULL to
  evalNode.
- Fixed some tests not to use setExpectedException, which caused the
  previous point to remain unnoticed: calling that method prevents the
  loop from continuing, and thus only the AbuseFilterParser part was
  being executed. The new implementation checks the exception ID and is
  thus more future-proof if the i18n message changes.
- Fixed some function names in error reporting for the old parser.
- The arg count is now checked outside of the function handlers, thus
  it's no more necessary to call checkEnoughArguments at the beginning
  of each handler. This also produces clearer error messages in case of
  aliases (e.g. set/set_var).
- Check the args count even if some of the args are DUNDEFINED. This is
  much easier now that the check is outside of the handler. This will
  make syntax check fail for e.g. `contains_any(added_lines)`.

Bug: T156095
Change-Id: I446a307e5395ea8cc8ec5ca5d5390b074bea2f24
2019-08-20 15:32:02 +00:00
..
api Add a new API module to retrieve private details from AbuseLog 2019-08-09 21:10:28 +00:00
pagers Tweak methods related to global filters 2019-07-02 17:02:50 +02:00
parser Better handling of function params in CachingParser 2019-08-20 15:32:02 +00:00
special Add a new API module to retrieve private details from AbuseLog 2019-08-09 21:10:28 +00:00
Views Fix object to array cast, typehint array params 2019-08-17 17:04:34 +00:00
AbuseFilter.php Merge "Various changes for blockautopromote" 2019-08-14 23:59:08 +00:00
AbuseFilterChangesList.php Merge "Don't send long patterns with GET" 2019-01-20 14:20:31 +00:00
AbuseFilterHooks.php Fix the warning about permission name changes 2019-08-13 14:40:17 +05:30
AbuseFilterModifyLogFormatter.php build: Upgrade phan-taint-check-plugin from 1.5.x to 2.0.1 2019-07-10 15:30:52 +00:00
AbuseFilterPreAuthenticationProvider.php Add a new class for methods related to running filters 2019-07-23 19:06:27 +00:00
AbuseFilterRightsLogFormatter.php Various changes for blockautopromote 2019-08-14 18:50:43 +02:00
AbuseFilterRunner.php Merge "Make parser aware of the filter it is parsing" 2019-08-20 12:50:26 +00:00
AbuseFilterSuppressLogFormatter.php Migrate AbuseFilter suppress log 2018-08-21 16:05:54 +00:00
AbuseFilterVariableHolder.php Specialize empty AFPData types 2019-08-04 15:26:57 +00:00
AbuseLogHitFormatter.php Minor escaping fixes 2018-07-05 18:51:30 +00:00
AFComputedVariable.php Profiling: don't count time for operations shared with the edit 2019-08-04 20:12:10 +00:00
TableDiffFormatterFullContext.php Fix coding conventions exclusion rules 2018-04-20 08:40:18 +00:00