PR-5.3-dev Pending

User tests: Successful: 0 Unsuccessful: 0

avatar brianteeman
brianteeman
20 Mar 2025

Summary of Changes

The $segments array is being accessed without first checking if it contains any elements. If $segments is empty, trying to access $segments[0] will trigger the warning. You need to check if the $segments array is not empty before accessing its elements

Testing Instructions

image

Open an article and change the user who created it
Check php error log

and/or code review

Actual result BEFORE applying this Pull Request

PHP Warning: Undefined array key 0 in D:\repos\j51\libraries\src\Table\Nested.php on line 1320

Expected result AFTER applying this Pull Request

no entry in the error-log

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 brianteeman brianteeman - open - 20 Mar 2025
avatar brianteeman brianteeman - change - 20 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Mar 2025
Category Libraries
avatar brianteeman brianteeman - change - 20 Mar 2025
The description was changed
avatar brianteeman brianteeman - edited - 20 Mar 2025
avatar brianteeman brianteeman - change - 20 Mar 2025
The description was changed
avatar brianteeman brianteeman - edited - 20 Mar 2025
avatar brianteeman brianteeman - change - 20 Mar 2025
Labels Added: PR-5.3-dev
avatar exlemor
exlemor - comment - 22 Mar 2025

Hi @brianteeman, I have 5.3 beta 3 and I am not able to find that PHP Warning in my error_log, do I need to download/install the nightly Joomla_5.3.0-beta4-dev-Development-Full_Package.zip to be able to test this on my test hosting? (sorry for the stupid question, just want to be able to test this)

avatar brianteeman
brianteeman - comment - 23 Mar 2025

@exlemor you probably need to ensure that php is set to log all errors and warnings
error_reporting=E_ALL

avatar bembelimen
bembelimen - comment - 25 Mar 2025

I see (from code review) that this is a valid fix and it should be merged, but I also can't find it where you had the testing instruction pointing to. (I set a break point and during the author change, this code is never called?) Probably I missed something?

Add a Comment

Login with GitHub to post a comment