Commit graph

266 commits

Author SHA1 Message Date
Kijin Sung
72c2b93790 Fix #2011 #2012 convert lang path before calling pathinfo() 2022-11-07 01:45:32 +09:00
Kijin Sung
606989c451 Also support $foo->$bar syntax in cond="" and loop="" syntax 2022-10-31 01:40:40 +09:00
Kijin Sung
2a026a6c86 Allow true/false/yes/no values for autoescape
템플릿의 <config autoescape="on" /> 문법이 on, off만 지원하기 때문에
흔히 사용하는 true, false, yes, no, Y, N 등의 불리언 값을 입력하면
안전하지 않은 off로 인식하게 됨. 이 경우에도 적절히 처리하도록 변경.
2022-10-30 22:28:39 +09:00
Kijin Sung
93a7348606 Support $foo->$bar syntax in templates
기존: $__Context->$__Context->bar 로 변환되어 오작동
개선: $__Context->{$__Context->bar} 로 변환되어 정상 작동되며
      변싱 순서에 따라 이 중괄호가 다시 해석되지는 않음
2022-10-30 21:41:40 +09:00
Kijin Sung
d2347d4208 Add template & scss syntax to refer to absolute paths within Rhymix installation directory
템플릿을 인클루드하거나 CSS, JS 등을 로딩할 때 다른 경로에 있는 파일을 상대경로로 참조하려고 하면
../../../../../layouts/path/to/target/asset.scss 처럼 상당히 많이 거슬러 올라가야 하는 경우가 있습니다.
이 때 맨 앞에 ^를 붙여 ^/layouts/path/to/target/asset.scss 라고 마치 절대경로처럼 쓰면
라이믹스 설치 경로 기준으로 (서브폴더에 설치한 경우 포함) 자동으로 변환하도록 하는 패치입니다.
즉 ^ 문자를 넣은 부분이 라이믹스 설치 경로로 치환된다고 보면 됩니다.

지원되는 곳:
  - <include target="^/path/to/file.html" />
  - <load target="^/path/to/file.css" />
  - <load target="^/path/to/file.js" />
  - SCSS에서 @import "^/path/to/file.scss";
2022-10-13 14:57:24 +09:00
Kijin Sung
099d8397c9 Prevent path conversion of data: URL in <img> tag 2022-07-11 21:55:09 +09:00
Kijin Sung
1c33529377 RVE-2022-3 filter tpl_path in TemplateHandler class
- $tpl_path에 템플릿 문법으로 오인할 수 있는 특수문자가 포함된 경우 삭제
- path traversal은 여기에서 방어하지 않음
2022-06-29 15:36:23 +09:00
Kijin Sung
9ce7593820 Fix error when loading external page in document root folder 2022-03-16 00:54:10 +09:00
Kijin Sung
f373e38d6d Fix #1893 duplicate function call when loop="" template syntax is used 2022-03-14 01:53:27 +09:00
Kijin Sung
0c31234e09 Fix isset(), unset() and empty() not working in template syntax 2022-02-16 13:15:31 +09:00
Kijin Sung
70cfe24cdd Use $this->user instead of $logged_info more consistently #1866 2022-02-04 01:19:30 +09:00
Kijin Sung
454d2d85ff Fix #1790 duplicate .html extension in TemplateHandler error message 2021-09-28 02:03:07 +09:00
Kijin Sung
15c43f13d2 Add option to disable automatically adding hidden inputs for mid, act, error-return-url to forms 2021-08-26 01:09:45 +09:00
Kijin Sung
d78ba8c77c Fix #1734 out-of-order loading of external CSS resource 2021-07-01 14:36:35 +09:00
Kijin Sung
827499bee3 Fix random content being replaced for widget output if skin path does not exist 2021-04-12 22:48:05 +09:00
Kijin Sung
76c6ef56f2 Treat $_SESSION specially in template code
https://xetown.com/questions/1522739
2021-02-04 15:58:32 +09:00
Kijin Sung
60465fb2db Fix various warnings in PHP 8.0 2021-01-28 22:32:56 +09:00
Kijin Sung
f4ad0dbb48 Fix #1551 incorrect conversion of jQuery template code in sitemap.xml (#1544 regression) 2021-01-09 10:39:56 +09:00
Chanyoung Oh
adcbe248c5 Improve url regular expression
- Improve regex to process non-whitespace characters only
- Remove /s flag
2021-01-07 13:21:57 +00:00
Chanyoung Oh
96bbbcf4bc Fix typo 2021-01-07 13:09:20 +00:00
Chanyoung Oh
db9e6050b2 Fix #1543 - Convert relative path in srcset attribute 2021-01-05 15:00:30 +00:00
Kijin Sung
49923844b2 Various fixes to remove warnings in PHP 8.0 2020-12-15 00:18:42 +09:00
Kijin Sung
4c62231e88 Fix template syntax for Context::unloadFile() and related unit tests 2020-12-13 21:33:27 +09:00
Kijin Sung
855e12a5de Fix misc warnings in PHP 8.0 2020-12-13 21:21:10 +09:00
Kijin Sung
417e4d15b0 More fixes to improve PHP 8.0 compatibility 2020-10-31 00:40:28 +09:00
Kijin Sung
a6bb44bf88 Convert PHP_EOL to \n for consistency
adf067e 보완

- classes 내에서 사용하는 PHP_EOL을 \n으로 교체
- common/framework/debug.php, common/scripts 내의 스크립트들은
  OS에 맞춰야 하므로 수정하지 않음
2020-08-06 14:54:32 +09:00
Kijin Sung
14ad62e869 Fix incorrect use of curly braces in legacy classes 2020-05-19 20:52:44 +09:00
Kijin Sung
72577ce6bb Fix #1174 Add number_shorten() function and 'shorten' template filter 2019-07-27 21:33:30 +09:00
Kijin Sung
b6b70bd8ad Add 'autolang' template filter for user lang handling
autoescape가 적용된 템플릿에서 사용자 정의 다국어가 제대로 출력되지 않는
문제를 수정하기 위해 'autolang' 필터를 추가함.
해당 변수 내용이 사용자 정의 다국어인 경우 escape하지 않고,
그 밖의 내용인 경우 escape하는 옵션임.
2018-10-11 13:56:11 +09:00
Kijin Sung
c54fa8dab1 Use escape more consistently
여기저기 htmlspecialchars가 들어 있는 것을 escape로 통일
2018-10-10 15:07:51 +09:00
Kijin Sung
6abd345dcf Fix autoescape problems
- 삼항식 사용시 autoescape 우선순위가 꼬이는 문제 수정
- $lang 변수는 autoescape하지 않도록 변경
- ENT_COMPAT을 ENT_QUOTES로 변경 (자바스크립트에서 사용시 '홑따옴표' 이탈 방지)
2018-10-10 14:43:53 +09:00
conory
eacf1c43f0 디버그 사용자일 경우 발생하는 템플릿 XML 오류 문제 수정 2018-04-16 10:11:31 +09:00
conory
c728250fd7 템플릿 foreach 처리시 디버그 편의를 위해 원래의 엄격한 방식으로 되돌림 2018-03-31 16:59:30 +09:00
conory
3d24c14f7f object 변수일 경우 템플릿 foreach 문이 작동하지 않는 문제 수정
#1023 문제 수정

레이아웃 확장변수 (extra_var)가 object 라서 발생한 warning 수정 (왜 object로 했는 지 모르겠지만, array가 더 맞는 듯함)
Warning: count(): Parameter must be an array or an object that implements Countable in php 7.2
2018-03-30 23:28:44 +09:00
conory
605fcc87df Fix unit test for template 2018-03-22 17:49:00 +09:00
conory
a8e9c58d7a inline 템플릿 문법 인식 오류 수정
a6e9222fac 보완

잘못 인식된 문법 ex)
<input cond="$a" type="text" value="{'">'|escape}" />
<p id="<!--@if($a)-->a" class="o"<!--@else-->c"<!--@end-->>abc</p><div cond="$c">123</div>
2018-03-22 16:34:19 +09:00
bnu
a6e9222fac cond, loop 등 템플릿 코드가 컴파일 되지 않고 출력되는 문제
- xpressengine/xe-core#2237
- 일부 해결됨을 확인하였으나, 다양한 환경에서 문제가 여전히 나타날 수 있음
2018-03-07 17:45:52 +09:00
Kijin Sung
e0a762d03a Use $lang as a local variable in template handler 2018-03-03 01:57:16 +09:00
Kijin Sung
9d06f6a9e2 Enable static calling of Context::init() and convert unnecessary instance properties into static properties 2018-03-03 01:44:05 +09:00
Kijin Sung
513f136c34 Isolate user-created template vars (Context::set) from Context instance properties 2018-03-02 21:02:59 +09:00
conory
13ebfbfa8c Revert "context property의 이름과 템플릿 내의 변수 이름이 같을 경우 덮어쓰지는 문제 수정"
This reverts commit 51bd96b66a.
2018-02-01 15:34:00 +09:00
conory
51bd96b66a context property의 이름과 템플릿 내의 변수 이름이 같을 경우 덮어쓰지는 문제 수정 2018-02-01 15:01:40 +09:00
conory
28dfc44a86 913ccf4a3c 보완 2018-01-29 23:38:19 +09:00
conory
913ccf4a3c 디버그 기능 사용시 템플릿 경로를 표시하는 주석 태그 추가
관리자일 경우에만 표시
위젯 캐시 등 사용시 템플릿 주석이 노출될 가능성이 있으므로 HTMLDisplayHandler->prepareToPrint()에서 주석 제거 처리
2018-01-29 22:08:39 +09:00
Kijin Sung
afc0f26d6c Fix path handling in TemplateHandler 2018-01-29 15:07:00 +09:00
Kijin Sung
9a87376e35 Always get $this->user directly from Rhymix\Framework\Session
서드파티 자료가 Context->get('logged_info')에 stdClass를 넣는 경우
$this->user->isAdmin() 등의 메소드를 사용할 수 없게 되는 문제 수정
2018-01-13 14:13:53 +09:00
Kijin Sung
3dbc600aa9 Suppress warnings thrown by count() in template parser 2017-12-09 02:39:14 +09:00
Min-Soo Kim
5140047b5f 네모의 꿈/ 컨텐츠 위젯 스킨 (#712)
## 컨텐츠 모듈 스킨

- 사이트 테마를 따르지 않고 다른 색을 선택할 수 있도록 네모의 꿈 회원 스킨 컬러셋 추가.
- 탭이 많을 때 터치 환경이 아니면 좌우로 넘기기 어려운 점을 고려하여서 메뉴를 펼침.
- 작은 화면에서 화면을 최대한 활용하도록, 레이아웃 햄버거 메뉴를 부드럽게 나타내고 감춥니다.

## 위젯에서 LESS/SCSS 의 사용
- 변수를 위젯 캐시에도 전달할 수 있도록 해서 LESS 나 SCSS 에 값 전달이 가능하도록 함.
- LESS 나 SCSS 를 사용한 경우에 위젯 코드 캐싱 코드가 적절하게 기록되도록 해서 LESS나 SCSS 를 사용
가능하도록 수정.

## 그 외 변화
- Reduce the number of regular expressions.
2017-02-26 01:05:57 +09:00
Kijin Sung
f338d38538 Improve regexp for template filters 2017-02-23 22:25:13 +09:00
Kijin Sung
d03c64d069 Make the test for filters more strict to prevent unintended parsing 2017-02-23 22:14:51 +09:00