Commit graph

283 commits

Author SHA1 Message Date
Kijin Sung
b2cac3e868 Remove old TemplateHandler class, leaving only an alias for BC 2023-10-15 00:54:59 +09:00
Kijin Sung
16572c4515 Make TemplateHandler inherit Template nstead of class_alias 2023-10-10 14:52:17 +09:00
Kijin Sung
3505d49de6 Separate common Template class from Template v1 parser 2023-10-03 23:27:02 +09:00
Kijin Sung
5a61bc62d3 Fix meaningful whitespace being hidden after template compile 2023-09-18 14:26:56 +09:00
Kijin Sung
fead32337e Fix incorrect debug comment for outer templates in a deeply nested include tree 2023-09-12 22:42:30 +09:00
Kijin Sung
7bba7732d7 Display relative path in "Template not found" error message 2023-09-09 01:39:07 +09:00
Kijin Sung
a50041007d Remove UTF-8 BOM and CRLF in templates when compiling them 2023-09-05 01:05:53 +09:00
Kijin Sung
7a62550c30 Fix incorrect handling of newline in TemplateHandler 2023-09-05 00:56:17 +09:00
Kijin Sung
fd27ec177b Refine empty line handling without changing line numbers 2023-09-05 00:42:12 +09:00
Kijin Sung
cd8e6371c6 Preserve line numbers when compiling templates 2023-09-05 00:17:15 +09:00
Kijin Sung
b6e1a4589a Fix #2131 missing translations 2023-06-22 21:55:25 +09:00
Kijin Sung
de2a9288f2 Add option to control how many seconds to wait before compiling updated template file 2023-06-18 23:01:59 +09:00
Kijin Sung
ded3b97208 Fix race condition when template file is being uploaded 2023-06-17 00:49:24 +09:00
Kijin Sung
dfa1e93c79 Remove unnecessary header and footer from class files
- 아래에 이미 author 언급이 있으므로 중복되는 저작권 표기는 제거
- 클래스 하단에 불필요한 end of file 표시 제거 (파일 하나에 클래스 하나씩이므로
  파일이 중간에 끊겼다면 클래스가 닫히지 않아 쉽게 알 수 있음)
2023-01-30 23:52:23 +09:00
Kijin Sung
c881e73c1d Remove trailing whitespace in legacy class files 2023-01-17 21:07:55 +09:00
Kijin Sung
3f3f270fda Reduce warnings due to undefined variables in templates
- 템플릿에서 변수를 단순 참조할 경우 ?? '' 를 붙여 워닝 방지
- 함수 호출이나 복잡한 문법 안에 들어간 변수까지 처리해 주지는 않음
- 불필요한 오류 메시지를 줄여서 정말 중요한 오류를 찾기 쉽도록
2023-01-17 00:00:34 +09:00
Kijin Sung
30493947d8 Fix deprecated ${var} syntax 2022-12-29 00:44:51 +09:00
Kijin Sung
9e9adcdb43 Remove support for targetie attribute on assets 2022-12-28 00:35:57 +09:00
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