Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
27 Nov 2026

Pull Request for Issue # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

This change was created with the help of AI (Claude Code).

Summary of Changes

The weblinks list models (administrator and site) build the title/alias search term as

$search = '%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%');

and then bind it with ->bind(':title', $search). Since the value is passed as a prepared statement parameter, it must not be escaped beforehand. Escaping it is driver dependent and leads to wrong results, e.g. on PostgreSQL escape() doubles single quotes, so a search for O'Brien searches for O''Brien and finds nothing. (The closing parenthesis was also placed after the '%' suffix, which only worked by accident.)

The term is now built as '%' . str_replace(' ', '%', trim($search)) . '%', like the core components (e.g. ContactsModel) do for bound search values.

Testing Instructions

  • On PostgreSQL, create a weblink with the title O'Brien's links.
  • Search for O'Brien in the backend weblinks list (and in the frontend list).
  • Repeat on MySQL to check that searching still works.

Expected result

The weblink is found on all databases.

Actual result

PostgreSQL: no weblink is found.

Documentation Changes Required

None

avatar Hackwar Hackwar - open - 27 Nov 2026
avatar Hackwar Hackwar - change - 27 Nov 2026
The description was changed
avatar Hackwar Hackwar - edited - 27 Nov 2026

Add a Comment

Login with GitHub to post a comment