PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar BrainforgeUK
BrainforgeUK
6 Dec 2023

Now uses strpos instead of preg_match.

Summary of Changes

In isRobot() use strpos() instead of preg_match() as that is faster.

See https://www.php.net/manual/en/function.preg-match.php#refsect1-function.preg-match-notes

Testing Instructions

A simply test available in this plugin.
bfisrobottest.zip

Install and on enabling the front-end displays the following on success:
Test (false):
Test (true):1
Test (true):1

Actual result BEFORE applying this Pull Request

Robots detected.

Expected result AFTER applying this Pull Request

Robots detected.
Its a big list of robots - possibly a detectable performance improvement,

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar BrainforgeUK BrainforgeUK - open - 6 Dec 2023
avatar BrainforgeUK BrainforgeUK - change - 6 Dec 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Dec 2023
Category Libraries
avatar BrainforgeUK BrainforgeUK - change - 6 Dec 2023
Labels Added: PR-4.4-dev
avatar Quy
Quy - comment - 7 Dec 2023

Lines 87, 95, 166, 250, 268, 391 should be changed.

avatar BrainforgeUK BrainforgeUK - change - 10 Dec 2023
The description was changed
avatar BrainforgeUK BrainforgeUK - edited - 10 Dec 2023
avatar Quy
Quy - comment - 22 Jan 2024

Please rebase for v5.1 as this is B/C break when extending the Browser class, and using $robots in it. Thanks.

avatar brianteeman
brianteeman - comment - 22 Jan 2024

@Quy if this is a b/c break then it can not be introduced in a minor release

avatar tomsrocket tomsrocket - test_item - 24 Feb 2024 - Tested successfully
avatar tomsrocket
tomsrocket - comment - 24 Feb 2024

I have tested this item ✅ successfully on 932b5cf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42474.

avatar viocassel viocassel - test_item - 26 Feb 2024 - Tested successfully
avatar viocassel
viocassel - comment - 26 Feb 2024

I have tested this item ✅ successfully on 932b5cf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42474.

avatar richard67
richard67 - comment - 26 Feb 2024

The PR needs to be rebased, so I can't set RTC. See previous comment #42474 (comment) .

avatar HLeithner
HLeithner - comment - 24 Apr 2024

If we don't use already a 3rd party library to maintain our browser detection we should do this, for example https://github.com/hisorange/browser-detect (just the first I found not validated if it's useful)

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Update Browser.php
[4.4] Update Browser.php
avatar HLeithner HLeithner - edited - 24 Apr 2024

Add a Comment

Login with GitHub to post a comment