mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Stop using ArrayObject in module part config
module part config에 배열을 저장한 경우 배열을 그대로 반환하고, 그렇지 않으면 항상 오브젝트를 반환하도록 변경함. 만약 ArrayObject가 저장되어 있는 경우 오브젝트로 변환하여 반환함. https://bugs.php.net/bug.php?id=77298 버그로 인해 ArrayObject를 serialize하여 저장했다가 나중에 다시 불러와서 조작하려고 하면 segfault가 발생함. 그 때문에 일부 PHP 7.3 버전에서 라이믹스를 정상적으로 사용하기가 불가능함. 특히 카페24의 PHP 7.3 웹호스팅에서 "페이지 로딩이 지연되었습니다" 에러 발생. PHP 엔진 자체의 버그이지만, 라이믹스에서 지원하는 버전 대역에 포함되어 있고 실제로 많이 사용되는 버전이므로 라이믹스에서 땜빵하는 것이 옳다고 생각됨. 만약 이 패치 때문에 설정을 제대로 불러오거나 저장할 수 없는 모듈이 발견된다면 해당 모듈을 수정해야 함. 자기 설정의 자료형이 뭔지도 모르는 모듈을 코어에서 배려해 줄 필요 없음.
This commit is contained in:
parent
953faecd55
commit
1254594a7c
1 changed files with 10 additions and 3 deletions
|
|
@ -1448,13 +1448,20 @@ class moduleModel extends module
|
|||
}
|
||||
else
|
||||
{
|
||||
$config = new ArrayObject;
|
||||
if (is_array($output->data->config))
|
||||
{
|
||||
$config = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$config = new stdClass;
|
||||
}
|
||||
}
|
||||
|
||||
// For access to array as properties
|
||||
// Deprecate use of ArrayObject because of https://bugs.php.net/bug.php?id=77298
|
||||
if($config instanceof ArrayObject)
|
||||
{
|
||||
$config->setFlags(ArrayObject::ARRAY_AS_PROPS);
|
||||
$config = (object)($config->getArrayCopy());
|
||||
}
|
||||
|
||||
// Set cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue