Skip to content

ext/phar: Fix .phar-prefixed non-magic directory handling - #22372

Closed
LamentXU123 wants to merge 1 commit into
php:PHP-8.4from
LamentXU123:phar-rebranch-on-8.4
Closed

ext/phar: Fix .phar-prefixed non-magic directory handling#22372
LamentXU123 wants to merge 1 commit into
php:PHP-8.4from
LamentXU123:phar-rebranch-on-8.4

Conversation

@LamentXU123

Copy link
Copy Markdown
Member

cc @Girgias :). Improved these logic by writing the phar_path_is_magic_phar helper as planned in #22011

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering long term all those paths should ideally be zend_strings I don't want a long name for it. And using an _ex suffix is quite common.

Comment thread ext/phar/phar_internal.h Outdated
Comment thread ext/phar/phar_internal.h Outdated
Co-authored-by: George Peter Banyard <girgias@php.net>
@LamentXU123
LamentXU123 marked this pull request as draft June 23, 2026 09:45
@LamentXU123
LamentXU123 force-pushed the phar-rebranch-on-8.4 branch from 10880f9 to ea7fe0b Compare June 23, 2026 09:46
@LamentXU123
LamentXU123 marked this pull request as ready for review June 23, 2026 09:47
@LamentXU123

Copy link
Copy Markdown
Member Author

Fixed :) I am wondering how to write NEWS for this one.

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NEWS file looks good to me. Careful when merging up as some pointers might have become zend_strings.

LamentXU123 added a commit that referenced this pull request Jun 23, 2026
* PHP-8.5:
  ext/phar: Fix .phar-prefixed non-magic directory handling (#22372)
@LamentXU123

Copy link
Copy Markdown
Member Author

Indeed. You might need to review the commits to upper branches after I push them to make sure everything works :) Thanks

pull Bot pushed a commit to dolfly/php-src that referenced this pull request Jun 23, 2026
* PHP-8.4:
  ext/phar: Fix .phar-prefixed non-magic directory handling (php#22372)
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
Use a shared helper for checking whether a path refers to the magic .phar
directory. Treat .phar itself and paths below it as magic, while allowing
non-magic entries that merely use a .phar-prefixed name such as .pharx.

Apply the same check across creation, copying, ArrayAccess, stream lookup,
directory iteration, extraction, and mounts so these paths are handled
consistently.

Co-authored-by: Gina Peter Banyard <girgias@php.net>

Closes php#22372
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
* PHP-8.4:
  ext/phar: Fix .phar-prefixed non-magic directory handling (php#22372)
adrian-enspired pushed a commit to adrian-enspired/php-src that referenced this pull request Aug 4, 2026
* PHP-8.5:
  ext/phar: Fix .phar-prefixed non-magic directory handling (php#22372)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants