Commit graph

272 commits

Author SHA1 Message Date
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
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