aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Utils.php
diff options
context:
space:
mode:
authorAurélien Tamisier <virtualtam+github@flibidi.net>2018-12-02 22:47:41 +0100
committerGitHub <noreply@github.com>2018-12-02 22:47:41 +0100
commit1004742f09b55ff781c13745781b9a7e90986faa (patch)
treeaa0e5743390296441edf09f44f95b3d21f2b5a16 /application/Utils.php
parent5e0a898bb13fad528514b0d33763bcaae38b45b0 (diff)
parent9d9f6d75b94aab51067bdfbe50b58b66d1194f6d (diff)
downloadShaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.gz
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.zst
Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.zip
Merge pull request #1234 from virtualtam/lint
Setup PHPCS and cleanup linter configuration
Diffstat (limited to 'application/Utils.php')
-rw-r--r--application/Utils.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/application/Utils.php b/application/Utils.php
index 97b12fcf..925e1a22 100644
--- a/application/Utils.php
+++ b/application/Utils.php
@@ -97,7 +97,7 @@ function escape($input)
97 97
98 if (is_array($input)) { 98 if (is_array($input)) {
99 $out = array(); 99 $out = array();
100 foreach($input as $key => $value) { 100 foreach ($input as $key => $value) {
101 $out[$key] = escape($value); 101 $out[$key] = escape($value);
102 } 102 }
103 return $out; 103 return $out;
@@ -355,10 +355,13 @@ function return_bytes($val)
355 $val = trim($val); 355 $val = trim($val);
356 $last = strtolower($val[strlen($val)-1]); 356 $last = strtolower($val[strlen($val)-1]);
357 $val = intval(substr($val, 0, -1)); 357 $val = intval(substr($val, 0, -1));
358 switch($last) { 358 switch ($last) {
359 case 'g': $val *= 1024; 359 case 'g':
360 case 'm': $val *= 1024; 360 $val *= 1024;
361 case 'k': $val *= 1024; 361 case 'm':
362 $val *= 1024;
363 case 'k':
364 $val *= 1024;
362 } 365 }
363 return $val; 366 return $val;
364} 367}
@@ -452,6 +455,7 @@ function alphabetical_sort(&$data, $reverse = false, $byKeys = false)
452 * 455 *
453 * @return string Text translated. 456 * @return string Text translated.
454 */ 457 */
455function t($text, $nText = '', $nb = 1, $domain = 'shaarli') { 458function t($text, $nText = '', $nb = 1, $domain = 'shaarli')
459{
456 return dn__($domain, $text, $nText, $nb); 460 return dn__($domain, $text, $nText, $nb);
457} 461}