Make WordPress Core


Ignore:
Timestamp:
11/28/2017 04:23:11 AM (7 years ago)
Author:
pento
Message:

General: Add inline PHPCS options to leave regex indentation.

We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the Squiz.Strings.ConcatenationSpacing.PaddingFound rule for these blocks stops the extra whitespace from being removed.

See #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r42228 r42249  
    10941094    }
    10951095
     1096    // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
    10961097    $regex =
    10971098    '(?:'
     
    11141115    . ')'
    11151116    . '\s*';              // Trailing space is optional except as mentioned above.
     1117    // phpcs:enable
    11161118
    11171119    // Although it is possible to reduce this procedure to a single regexp,
Note: See TracChangeset for help on using the changeset viewer.