fix #1510 이미지 경로 전에 cond사용이 제한되는 문제 고침

- `>`문자열로 img태그의 종료점을 찾으므로 `cond`속성을 먼저 사용할 경우 제한될 수 있었음
- test case 추가
This commit is contained in:
bnu 2015-06-04 15:08:34 +09:00
parent 98cc32a2ce
commit f6a538a655
2 changed files with 17 additions and 2 deletions

View file

@ -236,7 +236,7 @@ class TemplateHandler
$buff = preg_replace('@<!--//.*?-->@s', '', $buff);
// replace value of src in img/input/script tag
$buff = preg_replace_callback('/<(?:img|input|script)[^<>]*src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
$buff = preg_replace_callback('/<(?:img|input|script)(?(?=[[:space:]]+?cond=")[[:space:]]+?cond="[^"]+"|)[^<>]*[[:space:]]src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
// replace loop and cond template syntax
$buff = $this->_parseInline($buff);