Commit 8f4b7cce authored by mikeytown2's avatar mikeytown2 Committed by japerry

Issue #949098 by mikeytown2: Notice: Array to string conversion in ctools_preprocess_page

parent b3ab497c
......@@ -545,24 +545,27 @@ function ctools_preprocess_node(&$vars) {
function ctools_preprocess_page(&$variables) {
$tokens = ctools_set_page_token();
if (!empty($tokens)) {
$temp_tokens = array();
foreach ($tokens as $token => $key) {
list($type, $argument) = $key;
switch ($type) {
case 'variable':
$tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';
$temp_tokens[$token] = isset($variables[$argument]) ? $variables[$argument] : '';
break;
case 'callback':
if (is_string($argument) && function_exists($argument)) {
$tokens[$token] = $argument($variables);
$temp_tokens[$token] = $argument($variables);
}
if (is_array($argument) && function_exists($argument[0])) {
$function = array_shift($argument);
$argument = array_merge(array(&$variables), $argument);
$tokens[$token] = call_user_func_array($function, $argument);
$temp_tokens[$token] = call_user_func_array($function, $argument);
}
break;
}
}
$tokens = $temp_tokens;
unset($temp_tokens);
$variables['content'] = strtr($variables['content'], $tokens);
}
......
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