diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d8bff0f..99d045b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ * CHANGED: Passing large data structures by reference to reduce memory consumption (#858) * CHANGED: Removed use of ctype functions and polyfill library for ctype * CHANGED: Upgrading libraries to: DOMpurify 3.2.5, ip-lib 1.20.0 +* FIXED: Bump zlib library suffix, ensuring cache refresh for WASM streaming change +* FIXED: Handle undefined globals in file based persisted values (#1544) ## 1.7.6 (2025-02-01) * ADDED: Ability to copy the paste by clicking the copy icon button or using the keyboard shortcut ctrl+c/cmd+c (#1390 & #12) diff --git a/lib/Data/Filesystem.php b/lib/Data/Filesystem.php index ac91db11..85cd2a5e 100644 --- a/lib/Data/Filesystem.php +++ b/lib/Data/Filesystem.php @@ -276,7 +276,7 @@ class Filesystem extends AbstractData case 'purge_limiter': return $this->_storeString( $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php', - '_storeString( @@ -308,7 +308,9 @@ class Filesystem extends AbstractData $file = $this->_path . DIRECTORY_SEPARATOR . 'purge_limiter.php'; if (is_readable($file)) { require $file; - return $GLOBALS['purge_limiter']; + if (array_key_exists('purge_limiter', $GLOBALS)) { + return $GLOBALS['purge_limiter']; + } } break; case 'salt': @@ -324,9 +326,11 @@ class Filesystem extends AbstractData $file = $this->_path . DIRECTORY_SEPARATOR . 'traffic_limiter.php'; if (is_readable($file)) { require $file; - $this->_last_cache = $GLOBALS['traffic_limiter']; - if (array_key_exists($key, $this->_last_cache)) { - return $this->_last_cache[$key]; + if (array_key_exists('traffic_limiter', $GLOBALS)) { + $this->_last_cache = $GLOBALS['traffic_limiter']; + if (array_key_exists($key, $this->_last_cache)) { + return $this->_last_cache[$key]; + } } } break; diff --git a/tst/Data/FilesystemTest.php b/tst/Data/FilesystemTest.php index 3f0a1563..49ffe954 100644 --- a/tst/Data/FilesystemTest.php +++ b/tst/Data/FilesystemTest.php @@ -185,7 +185,9 @@ class FilesystemTest extends TestCase foreach (array('purge_limiter', 'salt', 'traffic_limiter') as $namespace) { file_put_contents($this->_invalidPath . DIRECTORY_SEPARATOR . $namespace . '.php', 'invalid content'); $model = new Filesystem(array('dir' => $this->_invalidPath)); + ob_start(); // hide "invalid content", when file gets included $this->assertEquals($model->getValue($namespace), '', 'empty default value returned, invalid content ignored'); + ob_end_clean(); $this->assertTrue($model->setValue(VALID, $namespace), 'setting valid value'); $this->assertEquals($model->getValue($namespace), VALID, 'valid value returned'); }