fix(release): 7.0.7 회귀 검수 발견 결함 3건 수정 — 표현식 배열 구조 분해·스케줄 확장 명령 웹 검증·JSON-LD 이스케이프
- 표현식 평가기가 화살표/함수 파라미터의 평탄한 배열 구조 분해(([k, v]) =>, 엘리전 홀)를 지원하지 않아 배포 레이아웃 60여 파일(게시판 권한 computed·검증 오류 표시)이 평가 실패하던 7.0.7 평가기 교체 회귀 수정 (engine-v1.60.5) + --production 재빌드. - 스케줄 저장 검증이 HTTP 문맥에서 확장 커맨드를 해석하지 못하던 문제(확장 프로바이더의 runningInConsole 등록 게이트로 Artisan 레지스트리 부재)를 프로바이더 $commands 선언 폴백으로 수정 — 판정 기준(클래스 네임스페이스 + 실제 명령명 대조) 동일, fail-closed 유지. - 봇 렌더 JSON-LD json_encode 에 JSON_HEX_TAG 추가 — 사용자 입력(검색어·게시글 제목)의 </script> 조기 종료로 인한 저장형 XSS 차단, schema.org 데이터는 무손실. - SeoMetaResolverTest 의 og_default_site_name 미고정 환경의존 실패를 setUp 고정으로 격리. - 루트 CHANGELOG 7.0.7 Security/Fixed 각 1건(기출시 결함만), 시나리오 매니페스트 2건 갱신.
This commit is contained in:
1 parent
b3d0da9355
commit
a1e1706ddc
13 files changed
+359
-28
No files matched your search
@@ -5,6 +5,15 @@
|
||||
>
|
||||
> 형식: [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)
|
||||
|
||||
## [engine-v1.60.5] - 2026-08-18
|
||||
|
||||
### Fixed
|
||||
|
||||
#### 화살표/함수 파라미터의 배열 구조 분해 지원 (`([key]) => …`)
|
||||
|
||||
- SafeExpressionEvaluator 파서가 화살표·함수 파라미터를 평문 식별자만 허용해, 레이아웃 전반에서 실사용 중인 `Object.entries(...).filter(([key]) => …)` / `.map(([k, v]) => …)` / `([, v]) => …` 형태가 `Expected ")" but found "=>"` 로 평가 실패했다. 게시판 환경설정의 권한 기본값 computed 4종이 계산되지 않아 권한 섹션이 헤더만 남고 비었고, 플러그인 설정·이커머스 폼의 검증 오류 표시(`([field, messages]) => …`)도 발화 시점에 같은 실패에 걸리는 상태였다 (7.0.7 평가기 교체 회귀 — 배포 레이아웃 60여 파일 사용).
|
||||
- 파라미터 목록 파서에 평탄한 배열 구조 분해 패턴(식별자 + 엘리전 홀)을 추가하고, 바인딩 시 홀은 건너뛰며 대상이 null/undefined 여도 예외 없이 undefined 를 바인딩한다. 중첩 패턴·rest·객체 구조 분해는 배포 레이아웃 사용이 0건이라 지원하지 않는다(형태가 어긋나면 종전과 같이 arrow 판정을 되돌린다).
|
||||
|
||||
## [engine-v1.60.4] - 2026-08-14
|
||||
|
||||
### Security
|
||||
|
||||
@@ -245,9 +245,17 @@ type Node =
|
||||
| { type: 'Empty' }
|
||||
| { type: 'Try'; block: Node; handlerParam: string | null; handler: Node | null; finalizer: Node | null };
|
||||
|
||||
/** 함수/화살표 파라미터 (기본값 지원) */
|
||||
/**
|
||||
* 함수/화살표 파라미터 (기본값 지원).
|
||||
*
|
||||
* 배열 구조 분해 패턴(`([key]) => …`, `([, v]) => …`)은 `name: null` +
|
||||
* `elements` 로 표현한다. `elements` 의 `null` 항목은 엘리전 홀(`[, v]`)이다.
|
||||
* 레이아웃 실사용 형태(`Object.entries(...).map(([k, v]) => …)`)가 이 문법에
|
||||
* 의존하므로 평문 식별자와 동급으로 지원한다. (engine-v1.60.5)
|
||||
*/
|
||||
interface Param {
|
||||
name: string;
|
||||
name: string | null;
|
||||
elements?: (string | null)[];
|
||||
default: Node | null;
|
||||
}
|
||||
|
||||
@@ -768,11 +776,20 @@ class Parser {
|
||||
if (this.isPunct(')')) return params; // 빈 목록
|
||||
for (;;) {
|
||||
const p = this.peek();
|
||||
if (!p || p.type !== 'ident' || FORBIDDEN_KEYWORDS.has(String(p.value))) {
|
||||
return null;
|
||||
let name: string | null = null;
|
||||
let elements: (string | null)[] | undefined;
|
||||
if (p && p.type === 'punct' && p.value === '[') {
|
||||
// 배열 구조 분해 패턴: [a, b] / [, v] / [a,] — 평탄한 식별자만 허용
|
||||
this.pos += 1; // [
|
||||
elements = this.tryParseArrayPatternElements();
|
||||
if (!elements) return null;
|
||||
} else {
|
||||
if (!p || p.type !== 'ident' || FORBIDDEN_KEYWORDS.has(String(p.value))) {
|
||||
return null;
|
||||
}
|
||||
name = String(p.value);
|
||||
this.pos += 1;
|
||||
}
|
||||
const name = String(p.value);
|
||||
this.pos += 1;
|
||||
let def: Node | null = null;
|
||||
if (this.isPunct('=')) {
|
||||
this.pos += 1; // =
|
||||
@@ -780,7 +797,7 @@ class Parser {
|
||||
// 콤마를 소비하지 않으므로 다음 파라미터 구분자 ',' 는 그대로 남는다.
|
||||
def = this.parseExpression();
|
||||
}
|
||||
params.push({ name, default: def });
|
||||
params.push(elements ? { name, elements, default: def } : { name, default: def });
|
||||
if (this.isPunct(',')) {
|
||||
this.pos += 1;
|
||||
continue;
|
||||
@@ -790,6 +807,44 @@ class Parser {
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배열 구조 분해 패턴의 요소를 파싱한다. 열림 `[` 는 호출부가 소비했고,
|
||||
* 닫힘 `]` 까지 소비한다. 엘리전 홀(`[, v]`)은 null 로 표현한다.
|
||||
* 중첩 패턴·rest·기본값 등 평탄한 식별자 외의 형태는 지원하지 않는다
|
||||
* (레이아웃 실사용 형태가 전부 평탄 — 형태가 어긋나면 null 로 arrow 판정 자체를 되돌린다).
|
||||
*
|
||||
* @return 요소 이름 배열(홀은 null), 또는 패턴 형태가 아니면 null
|
||||
*/
|
||||
private tryParseArrayPatternElements(): (string | null)[] | null {
|
||||
const elements: (string | null)[] = [];
|
||||
for (;;) {
|
||||
if (this.isPunct(']')) {
|
||||
this.pos += 1; // ]
|
||||
return elements;
|
||||
}
|
||||
if (this.isPunct(',')) {
|
||||
this.pos += 1; // 엘리전 홀
|
||||
elements.push(null);
|
||||
continue;
|
||||
}
|
||||
const t = this.peek();
|
||||
if (!t || t.type !== 'ident' || FORBIDDEN_KEYWORDS.has(String(t.value))) {
|
||||
return null;
|
||||
}
|
||||
elements.push(String(t.value));
|
||||
this.pos += 1;
|
||||
if (this.isPunct(',')) {
|
||||
this.pos += 1;
|
||||
continue;
|
||||
}
|
||||
if (this.isPunct(']')) {
|
||||
this.pos += 1; // ]
|
||||
return elements;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private parseArrowBody(): { body: Node; isBlock: boolean } {
|
||||
// 블록 본문: (…) => { statements } (return 으로 값 반환)
|
||||
if (this.isPunct('{')) {
|
||||
@@ -1502,7 +1557,19 @@ function bindParams(params: Param[], args: unknown[], local: Scope): void {
|
||||
if (v === undefined && p.default) {
|
||||
v = evalNode(p.default, local);
|
||||
}
|
||||
local.vars[p.name] = v;
|
||||
if (p.elements) {
|
||||
// 배열 구조 분해 패턴: 홀(null)은 건너뛰고 각 이름을 인덱스 값으로 바인딩.
|
||||
// 대상이 배열/문자열이 아니어도(undefined 포함) 예외 없이 undefined 바인딩 —
|
||||
// 표현식 평가 실패로 화면이 통째로 비는 것보다 관대한 해석이 낫다.
|
||||
const src = v as Record<number, unknown> | null | undefined;
|
||||
for (let ei = 0; ei < p.elements.length; ei++) {
|
||||
const name = p.elements[ei];
|
||||
if (name === null) continue;
|
||||
local.vars[name] = src == null ? undefined : src[ei];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
local.vars[p.name as string] = v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,52 @@ describe('SafeExpressionEvaluator', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('arrow-function 배열 구조 분해 파라미터 (7.0.7 회귀 — 게시판 환경설정 권한 computed)', () => {
|
||||
it('([key]) => — Object.entries 필터/맵 (admin_board_settings 실사용 형태)', () => {
|
||||
const ctx = {
|
||||
settings: {
|
||||
data: {
|
||||
basic_defaults: {
|
||||
default_board_permissions: { 'admin.manage': true, read: true, write: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
expect(
|
||||
evalx(
|
||||
"Object.entries(settings?.data?.basic_defaults?.default_board_permissions ?? {}).filter(([key]) => !key.startsWith('admin.')).map(([key]) => key)",
|
||||
ctx,
|
||||
),
|
||||
).toEqual(['read', 'write']);
|
||||
});
|
||||
|
||||
it('([k, v]) => — 키·값 동시 바인딩', () => {
|
||||
expect(evalx("Object.entries(o).map(([k, v]) => k + '=' + v).join(',')", { o: { a: 1, b: 2 } })).toBe(
|
||||
'a=1,b=2',
|
||||
);
|
||||
});
|
||||
|
||||
it('([field, messages]) => — 검증 오류 표시 형태 (플러그인 설정 onError 실사용)', () => {
|
||||
const ctx = { errors: { name: ['이름은 필수입니다'], email: ['형식 오류'] } };
|
||||
expect(evalx("Object.entries(errors ?? {}).map(([field, messages]) => field + ': ' + messages[0])", ctx)).toEqual([
|
||||
'name: 이름은 필수입니다',
|
||||
'email: 형식 오류',
|
||||
]);
|
||||
});
|
||||
|
||||
it('([,v]) => — 엘리전(홀) 패턴 (_bank_management_modal 실사용)', () => {
|
||||
expect(evalx('Object.entries(o).map(([,v]) => v)', { o: { a: 10, b: 20 } })).toEqual([10, 20]);
|
||||
});
|
||||
|
||||
it('function 선언 파라미터의 배열 구조 분해', () => {
|
||||
expect(evalx('(function f([a, b]) { return a + b; })([3, 4])')).toBe(7);
|
||||
});
|
||||
|
||||
it('구조 분해 대상이 아닌 값(undefined)은 각 이름에 undefined 바인딩', () => {
|
||||
expect(evalx('[undefined].map(([a]) => a === undefined)[0]')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('spread (array / object / call)', () => {
|
||||
it('배열 스프레드', () => {
|
||||
expect(evalx('[...a, ...b, 3]', { a: [1], b: [2] })).toEqual([1, 2, 3]);
|
||||
|
||||
Reference in new issue
Block a user