mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 04:12:18 +09:00
Issue 1038 fixed bugs of replacing path and target attribute in html <a> tag, when opage is compiled on page module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10245 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
63ba711c99
commit
cd90597c60
1 changed files with 2 additions and 3 deletions
|
|
@ -157,8 +157,7 @@
|
|||
@include($path);
|
||||
$content = ob_get_clean();
|
||||
// Replace relative path to the absolute path
|
||||
$path_info = pathinfo($path);
|
||||
$this->path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
|
||||
$this->path = str_replace('\\', '/', realpath(dirname($path))) . '/';
|
||||
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
|
||||
$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
|
||||
|
||||
|
|
@ -186,7 +185,7 @@
|
|||
$val = trim($matches[3]);
|
||||
// Pass if the path is external or starts with /, #, { characters
|
||||
// /=absolute path, #=hash in a page, {=Template syntax
|
||||
if(preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) {
|
||||
if(strpos($val, '.') === FALSE || preg_match('@^((?:http|https|ftp|telnet|mms)://|(?:mailto|javascript):|[/#{])@i',$val)) {
|
||||
return $matches[0];
|
||||
// In case of .. , get a path
|
||||
} elseif(preg_match('/^\.\./i',$val)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue