コード: 全て選択
Warning [PHP]: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in file manager/includes/document.parser.class.inc.php line 683
コード: 全て選択
function mergeSettingsContent($template) {
$replace= array ();
$matches= array ();
if (preg_match_all('~\[\(([a-z\_]*?)\)\]~', $template, $matches)) {
$settingsCount= count($matches[1]);
for ($i= 0; $i < $settingsCount; $i++) {
if (array_key_exists($matches[1][$i], $this->config))
$replace[$i]= $this->config[$matches[1][$i]];
}
$template= str_replace($matches[0], $replace, $template);
}
return $template;
}
コード: 全て選択
function mergeSettingsContent($template) {
$replace= array ();
$matches= array ();
if (preg_match_all('~\[\(([a-z\_]*?)\)\]~', $template, $matches)) {
$settingsCount= count($matches[1]);
if ($this->config){
for ($i= 0; $i < $settingsCount; $i++) {
if (array_key_exists($matches[1][$i], $this->config))
$replace[$i]= $this->config[$matches[1][$i]];
}
}
$template= str_replace($matches[0], $replace, $template);
}
return $template;
}