Open
Description
Describe the bug and add attachments
phpword 1.4.0 + PHP 8.2
\PhpOffice\PhpWord\IOFactory::load($path);
【strlen(): Passing null to parameter #1 ($string) of type string is deprecated】
Expected behavior
找到 Language.php 文件中的 validateLocale() 方法(第 235 行附近),添加对 null 值的检查
public function validateLocale($locale)
{
if ($locale === null) {
// 处理 null 值的情况,例如返回默认值或抛出异常
return $this->locale;
}
Steps to reproduce
\PhpOffice\PhpWord\IOFactory::load($path);
PHPWord version(s) where the bug happened
1.4.0
PHP version(s) where the bug happened
8.1/8.2
Priority
- I want to crowdfund the bug fix (with @algora-io) and fund a community developer.
- I want to pay the bug fix and fund a maintainer for that. (Contact @Progi1984)