관리자 폴더 화면에서도 영상 카드를 좌클릭하면 공개 폴더와 동일한
내부 팝업 플레이어로 재생되도록 함. 우클릭 컨텍스트 메뉴 (수정/이름
변경/삭제) 는 그대로 유지.
- 카드에 data-video-id 추가해 기존 player.js 가 인식하게 함
- 페이지에 playerOverlay HTML 과 player.js 스크립트 포함
- window.__SITE__.folder 도 함께 노출해 player.js 의 가정 충족
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
P1: views were emitting <%- JSON.stringify(...) %> directly inside <script>
tags. A video title like "</script><script>alert(1)</script>" would break
out of the script and inject HTML. Added res.locals.jsonForScript() that
escapes <, >, &, U+2028, U+2029 before output and switched all three
templates (op/editor.ejs, op/folder.ejs, folder.ejs) to use it.
P2: The internal popup player in /folder/:name always hit
/api/video/:id/file which returned the original. Made the file endpoint
default to the edited variant when present and only fall back to original
when ?edited=0 is given. Editor page passes ?edited=0 explicitly so the
operator always re-trims from the original. Standalone /player/:id no
longer needs the ?edited=1 hint.
Verified: rendered editor HTML escapes </script> payloads to \u003c/script,
default file endpoint serves edited.mp4 while ?edited=0 serves original.mp4.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>