Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnqueuedResourcesSniff: Trigger on enqueued resources in heredoc and nowdoc syntax. #877

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 21, 2017

Includes unit tests.

Also:

  • Adds unit tests for T_DOUBLE_QUOTED_STRING which were missing
  • Fixes bug in regexes which did not allow for quotes around the stylesheet phrase to be escaped.
  • Removed the blanket test exclusion for PHP 5.2 in favour of selective test exclusion.

Related to #764

…nowdoc syntax.

Includes unit tests.

Also:
* Adds unit tests for `T_DOUBLE_QUOTED_STRING` which were missing
* Fixes bug in regexes which did not allow for quotes around the `stylesheet` phrase to be escaped.
* Removed the blanket test exclusion for PHP 5.2 in favour of selective test exclusion.
@jrfnl jrfnl added this to the 0.12.0 milestone Mar 21, 2017
@@ -45,7 +47,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$tokens = $phpcsFile->getTokens();
$token = $tokens[ $stackPtr ];

if ( preg_match( '#rel=[\'"]?stylesheet[\'"]?#', $token['content'] ) > 0 ) {
if ( preg_match( '#rel=\\\\?[\'"]?stylesheet\\\\?[\'"]?#', $token['content'] ) > 0 ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta love \\\\

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, but it works.... 😍

escaping

@westonruter westonruter merged commit b61ffec into develop Mar 21, 2017
@westonruter westonruter deleted the feature/review-text-string-tokens-enqueued-resources branch March 21, 2017 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants