aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2012-02-12 18:56:53 -0800
committerAbinoam P. Marques Jr <abinoam@gmail.com>2012-02-12 18:56:53 -0800
commit9697e8233182bc084fb614b2c997b6e0c89c2441 (patch)
treecc5fc682ea9b8eeefe6fbbab2b7ffb0fedeb4f75 /include
parent135005571f4cfe3170b2f2ce0ea94b39a75c111a (diff)
parent3e85c1d3304c51489249ce2a284910885a1a3c73 (diff)
downloadvolse-hubzilla-9697e8233182bc084fb614b2c997b6e0c89c2441.tar.gz
volse-hubzilla-9697e8233182bc084fb614b2c997b6e0c89c2441.tar.bz2
volse-hubzilla-9697e8233182bc084fb614b2c997b6e0c89c2441.zip
Merge branch 'master' into bbcode
Diffstat (limited to 'include')
-rwxr-xr-xinclude/bbcode.php2
-rwxr-xr-xinclude/datetime.php9
-rwxr-xr-xinclude/network.php3
-rwxr-xr-xinclude/text.php6
4 files changed, 13 insertions, 7 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 9c70cb494..a4a651027 100755
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -11,7 +11,7 @@ function stripcode_br_cb($s) {
function tryoembed($match){
$url = ((count($match)==2)?$match[1]:$match[2]);
- logger("tryoembed: $url");
+// logger("tryoembed: $url");
$o = oembed_fetch_url($url);
diff --git a/include/datetime.php b/include/datetime.php
index d44e995cf..6d395fe3f 100755
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -260,10 +260,11 @@ function relative_date($posted_date) {
);
foreach ($a as $secs => $str) {
- $d = $etime / $secs;
- if ($d >= 1) {
- $r = round($d);
- return $r . ' ' . (($r == 1) ? $str[0] : $str[1]) . t(' ago');
+ $d = $etime / $secs;
+ if ($d >= 1) {
+ $r = round($d);
+ // translators - e.g. 22 hours ago, 1 minute ago
+ return sprintf( t('%1$d %2$s ago'),$r, (($r == 1) ? $str[0] : $str[1]));
}
}
}}
diff --git a/include/network.php b/include/network.php
index 551d5e1d0..25db62d16 100755
--- a/include/network.php
+++ b/include/network.php
@@ -579,6 +579,9 @@ function fetch_xrd_links($url) {
if(! function_exists('validate_url')) {
function validate_url(&$url) {
+ // no naked subdomains
+ if(strpos($url,'.') === false)
+ return false;
if(substr($url,0,4) != 'http')
$url = 'http://' . $url;
$h = @parse_url($url);
diff --git a/include/text.php b/include/text.php
index 46027a897..798e809d1 100755
--- a/include/text.php
+++ b/include/text.php
@@ -428,8 +428,10 @@ if(! function_exists('logger')) {
function logger($msg,$level = 0) {
// turn off logger in install mode
global $a;
- if ($a->module == 'install') return;
-
+ global $db;
+
+ if(($a->module == 'install') || (! ($db && $db->connected))) return;
+
$debugging = get_config('system','debugging');
$loglevel = intval(get_config('system','loglevel'));
$logfile = get_config('system','logfile');