From: Michael Vogel Date: Mon, 13 Jan 2014 00:34:54 +0000 (+0100) Subject: Some small bugfixes (mostly warnings) and little improvements to the log X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=de9a02b9aefdd0e7bdb5b0282da5501c076002b1;p=friendica.git Some small bugfixes (mostly warnings) and little improvements to the log --- diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 3306871d00..b4d91e08e5 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -320,7 +320,14 @@ function populate_acl($user = null,$celeb = false) { $o .= ''; $o .= '' . "\r\n"; $o .= '
' . "\r\n";*/ - + + // Not totally sure what input values can come + // This is a hotfix to prevent massive php warnings + if (is_array($user) AND isset($user["uid"])) + $uid = $user["uid"]; + else + $uid = intval($user); + $tpl = get_markup_template("acl_selector.tpl"); $o = replace_macros($tpl, array( '$showall'=> t("Visible to everybody"), @@ -334,8 +341,8 @@ function populate_acl($user = null,$celeb = false) { "aclautomention"=>(feature_enabled($user,"aclautomention")?"true":"false") ), )); - - + + return $o; } diff --git a/include/dba.php b/include/dba.php index dae1455931..293cce5780 100644 --- a/include/dba.php +++ b/include/dba.php @@ -99,7 +99,7 @@ class dba { if (($duration > $a->config["system"]["db_loglimit"])) { $duration = round($duration, 3); $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - @file_put_contents($a->config["system"]["db_log"], $duration."\t". + @file_put_contents($a->config["system"]["db_log"], datetime_convert()."\t".$duration."\t". basename($backtrace[1]["file"])."\t". $backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t". substr($sql, 0, 2000)."\n", FILE_APPEND); diff --git a/include/html2plain.php b/include/html2plain.php index dfb577abe1..bcdf89c2cc 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -218,7 +218,7 @@ function html2plain($html, $wraplength = 75, $compact = false) $message = html_entity_decode($message, ENT_QUOTES, 'UTF-8'); - if (!$compact) { + if (!$compact AND ($message != "")) { $counter = 1; foreach ($urls as $id=>$url) if (strpos($message, $url) === false) diff --git a/include/poller.php b/include/poller.php index 9ba9c782b7..9b18fe3c6d 100644 --- a/include/poller.php +++ b/include/poller.php @@ -89,6 +89,9 @@ function poller_run(&$argv, &$argc){ // Check OStatus conversations check_conversations(); + // To-Do: Regenerate usage statistics + // q("ANALYZE TABLE `item`"); + // once daily run birthday_updates and then expire in background $d1 = get_config('system','last_expire_day');