? Pending

User tests: Successful: Unsuccessful:

avatar berserkerx
berserkerx
16 Jul 2017

If class name starts with the same token, as namespace prefix or contains namespace prefix, the class was not loaded correctly.

Pull Request for Issue #17098 .

Summary of Changes

Added check for '/' after namespace prefix, replaced 'str_replace' with 'substr' to ensure, that prefix is only removed from the start of class path.

Testing Instructions

Create libraries/app/vendor/B/src/B.php class with anyMethod method.

JLoader::registerNamespace('B', JPATH_SITE . '/libraries/app/vendor/B/src', $reset = true, $prepend = false, $type = 'psr4');
\B\B::anyMethod();

Expected result

Autoloading \B\B class and calling anyMethod.

Actual result

Class not found.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar berserkerx berserkerx - open - 16 Jul 2017
avatar berserkerx berserkerx - change - 16 Jul 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2017
Category Libraries
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Jul 2017

Pull requests to the master branch of this repo are not accepted. Please close this pull request and submit a new one against the staging branch.
This is an automated message from the J!Tracker Application.

avatar berserkerx berserkerx - change - 16 Jul 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-07-16 12:12:18
Closed_By berserkerx
Labels Added: ?
avatar berserkerx berserkerx - change - 16 Jul 2017
Status Closed Pending
avatar berserkerx berserkerx - close - 16 Jul 2017
avatar berserkerx berserkerx - close - 16 Jul 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 5 Nov 2017
Status Pending Closed
Closed_Date 2017-07-16 12:12:18 2017-11-05 09:37:48
Closed_By berserkerx franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 5 Nov 2017

Add a Comment

Login with GitHub to post a comment