]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/action.php
Merge remote-tracking branch 'upstream/nightly' into nightly
[quix0rs-gnu-social.git] / lib / action.php
index 71441a31ffe2bb2a8764ba523ec382db855e95c1..bab8a6dbccdb00c9a6c3a3895855c24d59ed8f44 100644 (file)
@@ -394,8 +394,7 @@ class Action extends HTMLOutputter // lawsuit
     {
         $theme = new Theme($mainTheme);
 
-        // Some themes may have external stylesheets, such as using the
-        // Google Font APIs to load webfonts.
+        // Some themes may have external stylesheets
         foreach ($theme->getExternals() as $url) {
             $this->cssLink($url, $mainTheme, $media);
         }
@@ -429,14 +428,12 @@ class Action extends HTMLOutputter // lawsuit
                 $this->script('extlib/jquery.form.js');
                 $this->script('extlib/jquery-ui/jquery-ui.js');
                 $this->script('extlib/jquery.cookie.js');
-                $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/extlib/json2.js', GNUsocial::isHTTPS()).'"); }');
 
                 Event::handle('EndShowJQueryScripts', array($this));
             }
             if (Event::handle('StartShowStatusNetScripts', array($this))) {
                 $this->script('util.js');
                 $this->script('xbImportNode.js');
-                $this->script('geometa.js');
 
                 // This route isn't available in single-user mode.
                 // Not sure why, but it causes errors here.
@@ -493,10 +490,12 @@ class Action extends HTMLOutputter // lawsuit
 
         if (Event::handle('StartScriptVariables', array($this, &$vars))) {
             $vars['urlNewNotice'] = common_local_url('newnotice');
+            $vars['xhrTimeout'] = ini_get('max_execution_time')*1000;   // milliseconds
+            Event::handle('EndScriptVariables', array($this, &$vars));
         }
-        if (!empty($vars)) {
-            $this->inlineScript('SN.V = ' . json_encode($vars));
-        }
+
+        $this->inlineScript('SN.V = ' . json_encode($vars) . ';');
+
         return $vars;
     }
 
@@ -662,10 +661,14 @@ class Action extends HTMLOutputter // lawsuit
                     // if logo is an uploaded file, try to fall back to HTTPS file URL
                     $httpUrl = common_config('site', 'logo');
                     if (!empty($httpUrl)) {
-                        $f = File::getKV('url', $httpUrl);
-                        if (!empty($f) && !empty($f->filename)) {
-                            // this will handle the HTTPS case
-                            $logoUrl = File::url($f->filename);
+                        try {
+                            $f = File::getByUrl($httpUrl);
+                            if (!empty($f->filename)) {
+                                // this will handle the HTTPS case
+                                $logoUrl = File::url($f->filename);
+                            }
+                        } catch (NoResultException $e) {
+                            // no match
                         }
                     }
                 }