mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
could have been a copy&paste error, but the expression is also removing the </script> tag from valid script blocks (javascript for example). :)
git-svn-id: file:///svn/phpbb/trunk@6195 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
13bf07d275
commit
191a21d461
1 changed files with 3 additions and 2 deletions
|
@ -136,12 +136,13 @@ class template_compile
|
||||||
// php is a no-no. There is a potential issue here in that non-php
|
// php is a no-no. There is a potential issue here in that non-php
|
||||||
// content may be removed ... however designers should use entities
|
// content may be removed ... however designers should use entities
|
||||||
// if they wish to display < and >
|
// if they wish to display < and >
|
||||||
|
/*
|
||||||
$match_php_tags = array('#\<\?php.*?\?\>#is', '#<[^\w<]*(script)(((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?(language[^<>\'"]+("[^"]*php[^"]*"|\'[^\']*php[^\']*\'))((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?)?>.*?</script>#is', '#\<\?.*?\?\>#s', '#\<%.*?%\>#s');
|
$match_php_tags = array('#\<\?php.*?\?\>#is', '#<[^\w<]*(script)(((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?(language[^<>\'"]+("[^"]*php[^"]*"|\'[^\']*php[^\']*\'))((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?)?>.*?</script>#is', '#\<\?.*?\?\>#s', '#\<%.*?%\>#s');
|
||||||
$code = preg_replace($match_php_tags, '', $code);
|
$code = preg_replace($match_php_tags, '', $code);
|
||||||
|
*/
|
||||||
|
|
||||||
// An alternative to the above would be calling this function which would be the ultimate solution but also has it's drawbacks.
|
// An alternative to the above would be calling this function which would be the ultimate solution but also has it's drawbacks.
|
||||||
// At the moment it is commented out until we decide which method to use.
|
$this->remove_php_tags($code);
|
||||||
// $this->remove_php_tags($code);
|
|
||||||
|
|
||||||
// Pull out all block/statement level elements and seperate plain text
|
// Pull out all block/statement level elements and seperate plain text
|
||||||
preg_match_all('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', $code, $matches);
|
preg_match_all('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', $code, $matches);
|
||||||
|
|
Loading…
Add table
Reference in a new issue