public function replace_site_url_back($arr)
{
if ($arr == false) {
return;
}
if (is_string($arr)) {
$parser_mem_crc = 'replace_site_vars_back_' . crc32($arr);
if (isset($this->repaced_urls[$parser_mem_crc])) {
$ret = $this->repaced_urls[$parser_mem_crc];
} else {
$site = $this->site_url();
$ret = str_replace('{SITE_URL}', $site, $arr);
$this->repaced_urls[$parser_mem_crc] = $ret;
}
return $ret;
}
if (is_array($arr) and !empty($arr)) {
$ret = array();
foreach ($arr as $k => $v) {
if (is_array($v)) {
$v = $this->replace_site_url_back($v);
} elseif (is_string($v) and $v !== '0') {
$v = $this->replace_site_url_back($v);
}
$ret[$k] = $v;
}
return $ret;
}
}