-
Notifications
You must be signed in to change notification settings - Fork 18
refactor(assets): align dist filenames with webpack manifest #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5f5a2e3
f1b0696
cb08f43
d2775dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ public function boot( Service_Container $container ): void { | |
| * editor style | ||
| */ | ||
| private function style(): void { | ||
| $file = $this->assets->is_minified() ? $this->assets->get_min_file( 'editor.css' ) : 'editor.css'; | ||
| $file = $this->assets->get_min_file( 'editor.css' ); | ||
|
firestar300 marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * Do not enqueue a inexistant file on admin | ||
|
|
@@ -77,7 +77,7 @@ private function style(): void { | |
| * Editor script | ||
| */ | ||
| public function admin_editor_script(): void { | ||
| $file = $this->assets->is_minified() ? $this->assets->get_min_file( 'editor.js' ) : 'editor.js'; | ||
| $file = $this->assets->get_min_file( 'editor.js' ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Editor script guard bypassed when file is emptyMedium Severity When Reviewed by Cursor Bugbot for commit d2775dc. Configure here. |
||
| $filepath = 'dist/' . $file; | ||
|
|
||
| if ( ! file_exists( get_theme_file_path( $filepath ) ) ) { | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JS registration lacks empty-file guard unlike CSS paths
Medium Severity
get_min_file('js')returns an empty string whenassets.jsonis absent or lacks theapp.jskey. In that caseregister_scriptis called with path'dist/', registering a broken script URL pointing to a directory. The CSS equivalents (stylesheet_uriandlogin_stylesheet_uri) both have proper fallback chains (check for empty, try a hardcodeddist/app.css, then fall back to the original URI), but the JS registration has no guard or fallback at all. The old ternary guaranteed a non-empty'app.js'fallback in dev mode; removing it without adding an equivalent guard leaves the JS path unprotected.Additional Locations (1)
inc/Services/Assets.php#L108-L121Reviewed by Cursor Bugbot for commit d2775dc. Configure here.