$shortcut_icon = get_config("system", "shortcut_icon");
if ($shortcut_icon == "")
- $shortcut_icon = $this->get_baseurl()."/images/friendica-32.png";
+ $shortcut_icon = "images/friendica-32.png";
$touch_icon = get_config("system", "touch_icon");
if ($touch_icon == "")
- $touch_icon = $this->get_baseurl()."/images/friendica-128.png";
+ $touch_icon = "images/friendica-128.png";
$tpl = get_markup_template('head.tpl');
$this->page['htmlhead'] = replace_macros($tpl,array(
}
+ /**
+ * @brief Removes the baseurl from an url. This avoids some mixed content problems.
+ *
+ * @param string $url
+ *
+ * @return string The cleaned url
+ */
+ function remove_baseurl($url){
+
+ // Is the function called statically?
+ if (!is_object($this))
+ return(self::$a->remove_baseurl($url));
+
+ $url = normalise_link($url);
+ $base = normalise_link($this->get_baseurl());
+ $url = str_replace($base."/", "", $url);
+ return $url;
+ }
+
/**
* @brief Register template engine class
*
$this->performance[$value] += (float)$duration;
$this->performance["marktime"] += (float)$duration;
- // Trace the different functions with their timestamps
- $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
+ $callstack = $this->callstack();
- array_shift($trace);
+ $this->callstack[$value][$callstack] += (float)$duration;
- $function = array();
- foreach ($trace AS $func)
- $function[] = $func["function"];
+ }
- $function = implode(", ", $function);
+ /**
+ * @brief Returns a string with a callstack. Can be used for logging.
+ *
+ * @return string
+ */
+ function callstack() {
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 6);
- $this->callstack[$value][$function] += (float)$duration;
+ // We remove the first two items from the list since they contain data that we don't need.
+ array_shift($trace);
+ array_shift($trace);
+
+ $callstack = array();
+ foreach ($trace AS $func)
+ $callstack[] = $func["function"];
+ return implode(", ", $callstack);
}
function mark_timestamp($mark) {
$noid = get_config('system','no_openid');
- $dest_url = $a->get_baseurl(true) . '/' . $a->query_string;
+ $dest_url = $a->query_string;
if(local_user()) {
$tpl = get_markup_template("logout.tpl");
$opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
if (file_exists('view/theme/' . $t . '/style.php'))
- return($a->get_baseurl() . '/view/theme/' . $t . '/style.pcss' . $opts);
+ return('view/theme/'.$t.'/style.pcss'.$opts);
- return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
+ return('view/theme/'.$t.'/style.css');
}
function feed_birthday($uid,$tz) {
return '';
}
+
+function is_filled_array ($array) {
+ return (is_array($array) && count($array) > 0);
+}