Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http500 Warning: Use of undefined constant GLOB_BRACE #954

Closed
leaphy-dev opened this issue Oct 20, 2024 · 3 comments
Closed

http500 Warning: Use of undefined constant GLOB_BRACE #954

leaphy-dev opened this issue Oct 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@leaphy-dev
Copy link
Contributor

问题出处:

这个问题出在程序的哪一个具体功能?
使用本地随机图片
实际行为描述:
触发问题后造成了什么效果及影响?
文章装饰图片无法显示,http500错误

预期的行为:

这个功能应该有怎样的效果和影响?
正常显示
复现步骤:

怎样才能再次触发这个问题?
使用alipine Linux运行网站或者使用alipine php的docker镜像
配置与环境:
Alipine Linux
php:8.3.8

已经确认问题出现在/inc/classes/Image.php
是alpline linux的glub函数不支持GLOB_BRACE常量导致的

`
// $img_array = glob(STYLESHEETPATH . '/manifest/gallary/*.{gif,jpg,jpeg,png}', GLOB_BRACE);

        $folderPath = STYLESHEETPATH . '/manifest/gallary/';
        $allowedExtensions = array('jpg', 'jpeg', 'png', 'gif');
        $img_array = array();

        $files = scandir($folderPath);
        foreach ($files as $file) {
            // 检查文件扩展名是否在允许的范围内
            $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));
            if (in_array($extension, $allowedExtensions)) {
                $img_array[] =  STYLESHEETPATH . '/manifest/gallary/' . $file;
            }
        }

`

其实重写一下这个函数的功能可以暂时解决这个问题

@leaphy-dev leaphy-dev added the bug Something isn't working label Oct 20, 2024
Copy link

@LeaVES-0,感谢你给 sakurairo 提出了 issue。ヾ(≧▽≦*)o
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@mirai-mamori
Copy link
Owner

欢迎pr

leaphy-dev added a commit to leaphy-dev/Sakurairo that referenced this issue Oct 22, 2024
增强对Alpine Linux的兼容性
@leaphy-dev
Copy link
Contributor Author

已pr

mirai-mamori added a commit that referenced this issue Oct 31, 2024
mirai-mamori added a commit that referenced this issue Oct 31, 2024
commit 7e63831
Merge: 9a7330c f5d2f0b
Author: 染川 瞳 <[email protected]>
Date:   Thu Oct 31 15:38:56 2024 +0900

    Merge pull request #957 from LeaVES-0/patch-1

    fix issue #954

commit f5d2f0b
Author: LeaVES-0 <[email protected]>
Date:   Tue Oct 22 22:42:08 2024 +0800

    fix issue #954

    增强对Alpine Linux的兼容性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants