Skip to content

Commit

Permalink
Let see if this fixes it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Jul 11, 2016
1 parent 7373581 commit 40e6635
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions WordPress/Sniffs/PHP/DisallowAlternativeOpenTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {
$phpcsFile->addError( $error, $stackPtr, 'ASPShortOpenTagFound', $data );
}

if ( ( true === $asp_enabled && false === $short_enabled ) && ( T_INLINE_HTML === $openTag['code'] && 0 === strpos( $openTag['content'], '<%= ' ) ) ) {
if ( ( true === $asp_enabled && false === $short_enabled ) && ( T_INLINE_HTML === $openTag['code'] && 0 === strpos( $openTag['content'], '<%=' ) ) ) {

$error = 'Possible use of ASP style short opening tags. Needs manual inspection. Found: %s';
$data = array( $this->get_snippet( $openTag['content'] ) );
Expand All @@ -86,14 +86,12 @@ public function process( PHP_CodeSniffer_File $phpcsFile, $stackPtr ) {

if ( false === $asp_enabled && T_INLINE_HTML === $openTag['code'] ) {

if ( 0 === strpos( $openTag['content'], '<% ' ) ) {
$error = 'Possible use of ASP style opening tags. Needs manual inspection. Found: %s';
$code = 'MaybeASPOpenTagFound';
}

if ( 0 === strpos( $openTag['content'], '<%= ' ) ) {
if ( 0 === strpos( $openTag['content'], '<%=' ) ) {
$error = 'Possible use of ASP style short opening tags. Needs manual inspection. Found: %s';
$code = 'MaybeASPShortOpenTagFound';
} elseif ( 0 === strpos( $openTag['content'], '<%' ) ) {
$error = 'Possible use of ASP style opening tags. Needs manual inspection. Found: %s';
$code = 'MaybeASPOpenTagFound';
}

if ( isset( $error, $code ) ) {
Expand Down

0 comments on commit 40e6635

Please sign in to comment.