Fix matching of classes in trailing non-php text, fixes #1409
parent
b0b9c7b0d1
commit
51eca2cdfc
|
@ -121,7 +121,12 @@ class ClassMapGenerator
|
|||
$contents = preg_replace('{^.+?<\?}s', '<?', $contents);
|
||||
}
|
||||
// strip non-php blocks in the file
|
||||
$contents = preg_replace('{\?>.*<\?}s', '', $contents);
|
||||
$contents = preg_replace('{\?>.+<\?}s', '?><?', $contents);
|
||||
// strip trailing non-php code if needed
|
||||
$pos = strrpos($contents, '?>');
|
||||
if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) {
|
||||
$contents = substr($contents, 0, $pos);
|
||||
}
|
||||
|
||||
preg_match_all('{
|
||||
(?:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
class leading { }
|
||||
|
||||
<?php echo $queryClass ?>
|
||||
|
||||
class inner { }
|
||||
|
||||
<?php echo $defaultLocale ?>
|
||||
|
||||
class trailing { }
|
Loading…
Reference in New Issue