Skip to content

Commit

Permalink
More solid block content decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Feb 16, 2014
1 parent 23376d7 commit 05a3297
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/util/BlockUtil.php
Expand Up @@ -428,11 +428,9 @@ public static function loadAll()
*/
public static function varsFromContent($content)
{
// Assume serialized content ends in a ";" followed by some curly-end-braces
if (preg_match('/;}*$/', $content)) {
// Serialised content
$vars = unserialize($content);

// Try to unserialize first
$vars = unserialize($content);
if ($vars !== false && is_array($vars)) {
return $vars;
}

Expand Down

0 comments on commit 05a3297

Please sign in to comment.