Skip to content

Update the Gaurav theme's jQuery and Bootstrap, and drop jQuery from Basic Mobile - #350

Merged
mraible merged 5 commits into
roller-6.1.xfrom
gaurav-basicmobile-jquery-6.1.x
Nov 20, 2026
Merged

mraible merged 5 commits into
roller-6.1.xfrom
gaurav-basicmobile-jquery-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

This backports master's theme fixes to 6.1.x, with jQuery 3.8.0 in the Gaurav theme.

  • Gaurav: the theme shipped jQuery 1.12.4 and Bootstrap 3.4.0, which have known XSS vulnerabilities (CVE-2015-9251, CVE-2019-11358, CVE-2020-11022, CVE-2020-11023 and CVE-2019-8331). It now ships jQuery 3.8.0 and Bootstrap 3.4.1, the last Bootstrap 3 release. jQuery 3.8.0 is the unmodified dist/jquery.min.js from the npm package, checked against the registry's integrity hash. File names don't change, so the templates and theme.xml stay the same. (cherry-picked from eaca41f)
  • Basic Mobile: the theme loaded jQuery 2.1.1 and jQuery Mobile 1.4.2 from code.jquery.com over plain http. Its templates now use plain CSS in basic-mobile-custom.css and a few lines of plain JavaScript for the view switch. (cherry-picked from 021872f)
  • Basic Mobile follow-up: the mobile templates request their stylesheet with ?deviceType=mobile, and the day template's teaser test is fixed. Master's roller.js change in that commit isn't needed here, because 6.1.x's roller.js has no jQuery block. (cherry-picked from 7092e91)
  • roller-ui/scripts/jquery-2.1.1.min.js is removed. Nothing references it.
  • The binary LICENSE names jQuery 3.8.0 in place of the removed file and a jQuery UI 1.11.0 directory that is no longer in the tree.

On a local 6.1.x build, the Gaurav theme's jquery.js and bootstrap.js load without errors, and the navbar collapse and dropdown open. Weblogs that customized either theme keep their own copies of these files.

A further review pass added these fixes:

  • Submitting an empty search on the Basic Mobile theme shows the "enter a search term" alert again instead of running an empty search.
  • Entry pages no longer print the entry body twice, and the mobile stylesheet loads correctly under theme preview.
  • Both LICENSE files list the jQuery files that are bundled.

The gaurav theme bundled jQuery 1.12.4, which has known XSS vulnerabilities (CVE-2015-9251, CVE-2019-11358, CVE-2020-11022, CVE-2020-11023), and Bootstrap 3.4.0, which has CVE-2019-8331. It now ships jQuery 3.7.1 and Bootstrap 3.4.1, the last Bootstrap 3 release, taken unmodified from the official webjars. The old files were unmodified 3.4.0 releases, so no local changes are lost, and the file names stay the same so the theme's templates and theme.xml don't change. The theme uses only Bootstrap's collapse and dropdown plugins, both verified at phone and desktop widths.

roller-ui/scripts/jquery-2.1.1.min.js is removed. Nothing in Roller references it, and serving it exposed another vulnerable jQuery.

Weblogs that customized the gaurav theme keep their own copies of these files.

(cherry picked from commit eaca41f)
The theme loaded jQuery 2.1.1 and jQuery Mobile 1.4.2 from code.jquery.com over plain http. Both versions have known XSS vulnerabilities, jQuery Mobile is no longer maintained, and the standard weblog template's own Content-Security-Policy (script-src 'self') already blocked the script, which left its View Mobile Weblog link doing nothing.

The mobile templates keep their data-role markup, which the Velocity mobile macros also emit, and basic-mobile-custom.css now styles it directly: header and footer bars, inset list views with dividers, the next/previous navbar, and buttons. The category chooser opens with CSS :target from its existing #categories link. The view switch links carry ?deviceType=standard or ?deviceType=mobile, which MobileDeviceRepository already honors, and a few lines of plain JavaScript remember the choice in the roller_user_request_type cookie as before. permalink-mobile.vm's comment list also gets its missing closing </ul>.

roller-ui/styles/jquery.mobile-theme stays, because weblogs that customized this theme have their own copies of the templates that still reference it.

(cherry picked from commit 021872f)
The mobile templates now request their stylesheet with ?deviceType=mobile. The server picks a stylesheet rendition from the device cookie or user agent, so a mobile page reached through a ?deviceType=mobile link got the standard stylesheet; jQuery Mobile's own CSS used to hide that.

The mobile day template chose between an entry's text and its summary by testing whether the text was empty, so entries without a summary printed a literal $entry.transformedSummary or an empty teaser. It now tests the summary and uses quiet references.

roller.js is included with every weblog's comment form, but most themes don't load jQuery, so its form validation block threw "$ is not defined" on those pages. The block now runs only when jQuery Validation is present, which the admin and editor pages still load.

(cherry picked from commit 7092e91)
jQuery 3.8.0, released on 2026-11-17, fixes a ReDoS in selector identifier matching. The theme's jquery.js is the unmodified dist/jquery.min.js from the npm package, checked against the registry's integrity hash.

The binary LICENSE names it in place of the removed jquery-2.1.1.min.js and a jQuery UI 1.11.0 directory that is no longer in the tree.
…w stylesheet URL

The mobile search form's empty-search check called jQuery Mobile's popup API, which the Basic Mobile theme no longer loads, so the check threw and the empty search was submitted. It now opens the alert by setting the URL fragment, which the theme's :target rule displays.

Permalink pages printed the body of an entry with no summary twice, once as the teaser and once as the content. The teaser is now shown only in entry lists.

The mobile templates appended ?deviceType=mobile to a stylesheet URL that already has a query string under theme preview. They now append with an ampersand in that case.

Both LICENSE files now list the jQuery files and webjars that are actually bundled, instead of the removed jQuery 2.1.1 and jQuery UI 1.11.0 paths.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 218b0b386: The theme changes and rendering tests are consistent with the 6.1.x code. Compared with #348, the different Gaurav script approach is explained by master's jQuery 4 upgrade.

No new issues found.

@mraible
mraible merged commit 0777cce into roller-6.1.x Nov 20, 2026
7 checks passed
@mraible
mraible deleted the gaurav-basicmobile-jquery-6.1.x branch November 20, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants