mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2024-09-30 05:59:05 +00:00
fix processing of short php tags
This commit is contained in:
parent
6cee91b678
commit
00076827b1
@ -159,7 +159,7 @@ abstract class JEDCheckerHelper
|
|||||||
$isCleanComments = $options & self::CLEAN_COMMENTS;
|
$isCleanComments = $options & self::CLEAN_COMMENTS;
|
||||||
$isCleanStrings = $options & self::CLEAN_STRINGS;
|
$isCleanStrings = $options & self::CLEAN_STRINGS;
|
||||||
|
|
||||||
if (!preg_match('/<\?php\s/i', $content, $match, PREG_OFFSET_CAPTURE))
|
if (!preg_match('/<\?(?:php\s|\s|=)/i', $content, $match, PREG_OFFSET_CAPTURE))
|
||||||
{
|
{
|
||||||
// No PHP code found
|
// No PHP code found
|
||||||
return $isCleanHtml ? '' : $content;
|
return $isCleanHtml ? '' : $content;
|
||||||
@ -224,7 +224,7 @@ abstract class JEDCheckerHelper
|
|||||||
$cleanContent .= '?>';
|
$cleanContent .= '?>';
|
||||||
$pos += 2;
|
$pos += 2;
|
||||||
|
|
||||||
if (!preg_match('/<\?php\s/i', $content, $match, PREG_OFFSET_CAPTURE, $pos))
|
if (!preg_match('/<\?(?:php\s|\s|=)/i', $content, $match, PREG_OFFSET_CAPTURE, $pos))
|
||||||
{
|
{
|
||||||
// No PHP code found (up to the end of the file)
|
// No PHP code found (up to the end of the file)
|
||||||
return $cleanContent . ($isCleanHtml ? '' : substr($content, $pos));
|
return $cleanContent . ($isCleanHtml ? '' : substr($content, $pos));
|
||||||
|
Loading…
Reference in New Issue
Block a user