]> 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 e6b62f750f18adb9dee887247cf0c8714fdc3469..ce5da1cd8134fa050087511392d0c9f2aed06a24 100644 (file)
@@ -848,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)) {
@@ -872,8 +872,10 @@ 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)) {
@@ -1499,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) {