Skip to content

Wrongly identify phar (PHP Archive) #12326

@MaMaKow

Description

@MaMaKow

if (strpos($path, '.phar') !== false) {

I have my older classes organized with the pattern class.$classname.php
I have a class called pharmacy_emergency_service_builder.
Therefore I have a file: class.pharmacy_emergency_service_builder.php
This file is not a PHP Archive. But the filename contains the substring ".phar" if you look closely.

In line 768 the code
if (strpos($path, '.phar') !== false) {
matches my classname and adds "phar://" to the filename in autoload_classmap.php
A better way, to only match files ending in .phar would be
if (substr($path, -5) === '.phar') {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions