]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Fixes #526: bad font size separator in tagcloud with some locale
[github/shaarli/Shaarli.git] / index.php
index 79c66648fdb882944060dbdf1ac624f48095b3f8..735615ff7b084326aef7dc8dfee611021b73fe3a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -484,7 +484,7 @@ if (isset($_POST['login']))
         if (isset($_POST['returnurl'])) {
             // Prevent loops over login screen.
             if (strpos($_POST['returnurl'], 'do=login') === false) {
-                header('Location: '. escape($_POST['returnurl']));
+                header('Location: '. generateLocation($_POST['returnurl'], $_SERVER['HTTP_HOST']));
                 exit;
             }
         }
@@ -1015,11 +1015,16 @@ function renderPage()
             return strcasecmp($a, $b);
         });
 
-        $tagList=array();
-        foreach($tags as $key=>$value)
-        // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes.
-        {
-            $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6);
+        $tagList = array();
+        foreach($tags as $key => $value) {
+            // Tag font size scaling:
+            //   default 15 and 30 logarithm bases affect scaling,
+            //   22 and 6 are arbitrary font sizes for max and min sizes.
+            $size = log($value, 15) / log($maxcount, 30) * 2.2 + 0.8;
+            $tagList[$key] = array(
+                'count' => $value,
+                'size' => number_format($size, 2, '.', ''),
+            );
         }
 
         $data = array(
@@ -1054,7 +1059,7 @@ function renderPage()
             startsWith($query,'do='. $targetPage) && !isLoggedIn()
         );
         $cached = $cache->cachedVersion();
-        if (false && !empty($cached)) {
+        if (!empty($cached)) {
             echo $cached;
             exit;
         }