From 80ac96b791840411f538d00fee5f435e1793bec9 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 18 Apr 2022 09:19:34 +0800 Subject: [PATCH] * Fix bug #21770. --- module/api/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/api/model.php b/module/api/model.php index 4454e040a2..ff64cbdfbd 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -850,6 +850,6 @@ class apiModel extends model private function getDemoData($table, $version) { $file = $this->app->getAppRoot() . 'db' . DS . 'api' . DS . $version . DS . $table; - return unserialize(file_get_contents($file)); + return unserialize(preg_replace_callback('#s:(\d+):"(.*?)";#s', function($match){return 's:'.strlen($match[2]).':"'.$match[2].'";';}, file_get_contents($file))); } }