Repository navigation
web: change URL of jquery .js file - #7425
davidpanderson wants to merge 1 commit into
Conversation
- use current version (4.0.0) - include integrity checksum - let project.inc override it
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="html/inc/util.inc">
<violation number="1" location="html/inc/util.inc:57">
P2: `JQUERY_REF` cannot be overridden from the usual later part of `project.inc` when a page requires `project.inc` directly, because `project.inc` loads `util.inc` before reaching that definition. Load the override before `util.inc` or change the initialization order so all project entry paths honor it.</violation>
<violation number="2" location="html/inc/util.inc:59">
P3: The default now loads the unminified jQuery build on every page, replacing the existing `.slim.min.js` and adding avoidable transfer and parse cost for all users. Use `jquery-4.0.0.slim.min.js` with its matching integrity hash.</violation>
</file>
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
| } else { | ||
| date_default_timezone_set('UTC'); | ||
| } | ||
| if (!defined('JQUERY_REF')) { |
There was a problem hiding this comment.
P2: JQUERY_REF cannot be overridden from the usual later part of project.inc when a page requires project.inc directly, because project.inc loads util.inc before reaching that definition. Load the override before util.inc or change the initialization order so all project entry paths honor it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At html/inc/util.inc, line 57:
<comment>`JQUERY_REF` cannot be overridden from the usual later part of `project.inc` when a page requires `project.inc` directly, because `project.inc` loads `util.inc` before reaching that definition. Load the override before `util.inc` or change the initialization order so all project entry paths honor it.</comment>
<file context>
@@ -56,6 +54,13 @@ if (defined('TIMEZONE')) {
} else {
date_default_timezone_set('UTC');
}
+if (!defined('JQUERY_REF')) {
+ define('JQUERY_REF',
+'src="https://code.jquery.com/jquery-4.0.0.slim.js"
</file context>
| } | ||
| if (!defined('JQUERY_REF')) { | ||
| define('JQUERY_REF', | ||
| 'src="https://code.jquery.com/jquery-4.0.0.slim.js" |
There was a problem hiding this comment.
P3: The default now loads the unminified jQuery build on every page, replacing the existing .slim.min.js and adding avoidable transfer and parse cost for all users. Use jquery-4.0.0.slim.min.js with its matching integrity hash.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At html/inc/util.inc, line 59:
<comment>The default now loads the unminified jQuery build on every page, replacing the existing `.slim.min.js` and adding avoidable transfer and parse cost for all users. Use `jquery-4.0.0.slim.min.js` with its matching integrity hash.</comment>
<file context>
@@ -56,6 +54,13 @@ if (defined('TIMEZONE')) {
}
+if (!defined('JQUERY_REF')) {
+ define('JQUERY_REF',
+'src="https://code.jquery.com/jquery-4.0.0.slim.js"
+integrity="sha256-M+GjhMBfXikM1izMplICCTscIj5hzPCp6uDzaypxtgg="
+crossorigin="anonymous"'
</file context>
Summary by cubic
Updates the jQuery reference to 4.0.0 with an integrity checksum, and lets projects override it via project.inc.
JQUERY_URLconstant withJQUERY_REF, which now embeds the full script tag attributes (src, integrity, crossorigin).JQUERY_REFin project.inc before the auto-set overrides the default.Written for commit 6818491. Summary will update on new commits.