Commit f74aa0b8 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Gerrit Code Review
Browse files

Merge "Bug 1816840: Adjustments to dwoo library to fix unserialize problem"

parents 86cdf511 9d554c02
......@@ -38,3 +38,9 @@ composer dump-autoload -o
Then remove the hashes from the auto-generated /vendor files: E.g.
ComposerAutoloaderInit26e38f1cfb40040c9ff6097c09aee6d7::getLoader();
becomes ComposerAutoloaderInit::getLoader();
Additional changes:
The Dwoo plugin is being unmaintained again so we need also make any
changes committed to their master branch
https://github.com/dwoo-project/dwoo/compare/1.3.7...master
......@@ -71,7 +71,7 @@ class Loader implements ILoader
if (file_exists($cacheFile)) {
$chachedClassPath = unserialize(file_get_contents($cacheFile));
$chachedClassPath = @unserialize(file_get_contents($cacheFile));
if (is_array($chachedClassPath)) {
$this->classPath = $chachedClassPath + $this->classPath;
......@@ -180,9 +180,15 @@ class Loader implements ILoader
$cacheFile = $this->cacheDir . 'classpath-' . substr(strtr($pluginDir, '/\\:' . PATH_SEPARATOR, '----'),
strlen($pluginDir) > 80 ? - 80 : 0) . '.d' . Core::RELEASE_TAG . '.php';
$this->paths[$pluginDir] = $cacheFile;
$chachedClassPath = null;
if (file_exists($cacheFile)) {
$classpath = file_get_contents($cacheFile);
$this->classPath = unserialize($classpath) + $this->classPath;
$chachedClassPath = @unserialize(file_get_contents($cacheFile));
}
if (is_array($chachedClassPath)) {
$this->classPath = $chachedClassPath + $this->classPath;
} else {
$this->rebuildClassPathCache($pluginDir, $cacheFile);
}
......
......@@ -60,8 +60,7 @@ class PluginIf extends BlockPlugin implements ICompilableBlock, IElseable
{
$p = array();
reset($params);
while (list($k, $v) = each($params)) {
foreach($params as $k => $v) {
$v = (string)$v;
if (substr($v, 0, 1) === '"' || substr($v, 0, 1) === '\'') {
$vmod = strtolower(substr($v, 1, - 1));
......
......@@ -92,7 +92,7 @@ class PluginTextformat extends BlockPlugin
"\r"
), "\n", $this->buffer));
while (list($i) = each($pgs)) {
foreach($pgs as $i => $v) {
if (empty($pgs[$i])) {
continue;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment