mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Optimizer 사용시 특정 서버마다 배경 이미지등이 나타나지 않는 문제 해결
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3732 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
aba0dbe595
commit
472b39b70c
2 changed files with 7 additions and 5 deletions
|
|
@ -379,6 +379,7 @@
|
||||||
if($val && iconv($charset,$charset,$val)!=$val) $flag = false;
|
if($val && iconv($charset,$charset,$val)!=$val) $flag = false;
|
||||||
}
|
}
|
||||||
if($flag == true) {
|
if($flag == true) {
|
||||||
|
if($charset == 'UTF-8') return $obj;
|
||||||
foreach($obj as $key => $val) $obj->{$key} = iconv($charset,'UTF-8',$val);
|
foreach($obj as $key => $val) $obj->{$key} = iconv($charset,'UTF-8',$val);
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,11 +178,10 @@ if(!$cached) {
|
||||||
**/
|
**/
|
||||||
function replaceCssPath($file, $str) {
|
function replaceCssPath($file, $str) {
|
||||||
// css 파일의 위치를 구함
|
// css 파일의 위치를 구함
|
||||||
$this->tmp_css_path = './'.preg_replace("/^\.\//is","",dirname($file))."/";
|
$this->tmp_css_path = preg_replace("/^\.\//is","",dirname($file))."/";
|
||||||
|
|
||||||
// url() 로 되어 있는 css 파일의 경로를 변경
|
// url() 로 되어 있는 css 파일의 경로를 변경
|
||||||
$str = preg_replace_callback('!url\(("|\')?([^\)]+)("|\')?\)!is', array($this, '_replaceCssPath'), $str);
|
$str = preg_replace_callback('/url\(([^\)]*)\)/is', array($this, '_replaceCssPath'), $str);
|
||||||
$str = preg_replace('!\/([^\/]*)\/\.\.\/!is','/', $str);
|
|
||||||
|
|
||||||
// charset 지정 문구를 제거
|
// charset 지정 문구를 제거
|
||||||
$str = preg_replace('!@charset([^;]*?);!is','',$str);
|
$str = preg_replace('!@charset([^;]*?);!is','',$str);
|
||||||
|
|
@ -191,8 +190,10 @@ if(!$cached) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _replaceCssPath($matches) {
|
function _replaceCssPath($matches) {
|
||||||
if(preg_match("/^(http|\/|\.\/common\/)/is",$matches[2])) return $matches[0];
|
$path = str_replace(array('"',"'"),'',$matches[1]);
|
||||||
return sprintf('url(%s%s)', $matches[1], $this->tmp_css_path.$matches[2]);
|
if(preg_match('/^http/i', $path) || preg_match('/\.htc$/i',$path) ) return $matches[0];
|
||||||
|
|
||||||
|
return 'url("../../../../'.$this->tmp_css_path.$path.'")';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue