]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Merge branch '0.9.x' into facebook-upgrade
[quix0rs-gnu-social.git] / lib / util.php
index 5a94182bda6d8fd48214636d34cae7845bf3835f..68592bf74654f60e50a110a9cfa582e94297bc36 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');
@@ -876,7 +877,7 @@ function common_linkify($url) {
     }
 
     if (!empty($f)) {
-        if ($f->getEnclosure() || File_oembed::staticGet('file_id',$f->id)) {
+        if ($f->getEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;
 
@@ -974,8 +975,9 @@ function common_tag_link($tag)
     $canonical = common_canonical_tag($tag);
     if (common_config('singleuser', 'enabled')) {
         // regular TagAction isn't set up in 1user mode
+        $user = User::singleUser();
         $url = common_local_url('showstream',
-                                array('nickname' => common_config('singleuser', 'nickname'),
+                                array('nickname' => $user->nickname,
                                       'tag' => $canonical));
     } else {
         $url = common_local_url('tag', array('tag' => $canonical));
@@ -1008,7 +1010,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');
@@ -1079,7 +1081,17 @@ function common_local_url($action, $args=null, $params=null, $fragment=null, $ad
 
 function common_is_sensitive($action)
 {
-    static $sensitive = array('login', 'register', 'passwordsettings', 'api');
+    static $sensitive = array(
+        'login',
+        'register',
+        'passwordsettings',
+        'api',
+        'ApiOauthRequestToken',
+        'ApiOauthAccessToken',
+        'ApiOauthAuthorize',
+        'ApiOauthPin',
+        'showapplication'
+    );
     $ssl = null;
 
     if (Event::handle('SensitiveAction', array($action, &$ssl))) {
@@ -1487,6 +1499,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) {