View Issue Details

IDProjectCategoryView StatusLast Update
0035200mantisbtuipublic2025-03-01 18:40
Reporterraspopov Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.27.0 
Target Version2.27.1Fixed in Version2.27.1 
Summary0035200: Plug-in listing error during the language test process.
Description

On the screenshot you can see that the list of plugins also includes the ‘.’ and ‘...’ folders. And even tries to test them.

Steps To Reproduce

Open: admin/test_langs.php

TagsPHP 8.2
Attached Files
plugin-test-error.png (45,916 bytes)   
plugin-test-error.png (45,916 bytes)   

Relationships

related to 0027383 closeddregad Refactor and improve output of 'test_langs.php' admin script 

Activities

raspopov

raspopov

2024-12-24 11:02

reporter   ~0069606

Last edited: 2024-12-24 11:02

PR: 2063.

raspopov

raspopov

2024-12-24 11:03

reporter   ~0069607

After PR:

plugin-test-ok.png (34,734 bytes)   
plugin-test-ok.png (34,734 bytes)   
dregad

dregad

2024-12-26 06:04

developer   ~0069609

That's weird, I'm 100% sure this used to work correctly, and this code has not been touched since I refactored the language checks back in 2021 (0027383). Maybe something changed in PHP, let me check.

dregad

dregad

2024-12-26 06:33

developer   ~0069610

Yep that's it. Works fine in PHP <= 8.1, broken since 8.2.

https://www.php.net/manual/en/migration82.incompatible.php#migration82.incompatible.standard

FilesystemIterator::__construct(): prior to PHP 8.2.0, FilesystemIterator::SKIP_DOTS constant was always set and couldn't be disabled. In order to maintain the previous behaviour the constant must be explicitly set when using the flags parameter. The default value from flags parameter has not been modified.

So all we need is to add the FileSystemIterator::SKIP_DOTS flag, no need to rewrite the whole get_plugins() function.

raspopov

raspopov

2024-12-26 11:48

reporter   ~0069612

add the FileSystemIterator::SKIP_DOTS

It's elegant.

Related Changesets

MantisBT: master-2.27 1f556e79

2024-12-26 06:34

dregad


Details Diff
Fix test_langs.php processing ./.. as plugins

Since PHP 8.2, dot directories are no longer excluded by default by
FileSystemOperator [1].

Fixes 0035200

[1]: https://www.php.net/manual/en/migration82.incompatible.php#migration82.incompatible.standard
Affected Issues
0035200
mod - admin/test_langs.php Diff File