]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Merge remote branch 'gitorious/0.9.x' into 0.9.x
[quix0rs-gnu-social.git] / lib / util.php
index 6044fdd92ea98b1d3c46d39b74790ab2e234ad6d..ce5da1cd8134fa050087511392d0c9f2aed06a24 100644 (file)
@@ -326,7 +326,8 @@ function common_set_cookie($key, $value, $expiration=0)
                      $value,
                      $expiration,
                      $cookiepath,
-                     $server);
+                     $server,
+                     common_config('site', 'ssl')=='always');
 }
 
 define('REMEMBERME', 'rememberme');
@@ -847,7 +848,7 @@ function common_linkify($url) {
 
         $canon = File_redirection::_canonUrl($url);
 
-        $longurl_data = File_redirection::where($canon);
+        $longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links'));
         if (is_array($longurl_data)) {
             $longurl = $longurl_data['url'];
         } elseif (is_string($longurl_data)) {
@@ -871,12 +872,14 @@ function common_linkify($url) {
     $f = File::staticGet('url', $longurl);
 
     if (empty($f)) {
-        // XXX: this writes to the database. :<
-        $f = File::processNew($longurl);
+        if (common_config('attachments', 'process_links')) {
+            // XXX: this writes to the database. :<
+            $f = File::processNew($longurl);
+        }
     }
 
     if (!empty($f)) {
-        if ($f->getEnclosure() || File_oembed::staticGet('file_id',$f->id)) {
+        if ($f->getEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;
 
@@ -1009,7 +1012,7 @@ function common_group_link($sender_id, $nickname)
         $attrs = array('href' => $group->permalink(),
                        'class' => 'url');
         if (!empty($group->fullname)) {
-            $attrs['title'] = $group->fullname . ' (' . $group->nickname . ')';
+            $attrs['title'] = $group->getFancyName();
         }
         $xs = new XMLStringer();
         $xs->elementStart('span', 'vcard');
@@ -1498,6 +1501,7 @@ function common_request_id()
 function common_log($priority, $msg, $filename=null)
 {
     if(Event::handle('StartLog', array(&$priority, &$msg, &$filename))){
+       $msg = (empty($filename)) ? $msg : basename($filename) . ' - ' . $msg;
         $msg = '[' . common_request_id() . '] ' . $msg;
         $logfile = common_config('site', 'logfile');
         if ($logfile) {