]> git.mxchange.org Git - friendica-addons.git/commitdiff
Fix errors
authorArt4 <art4@wlabs.de>
Sat, 7 Dec 2024 22:08:59 +0000 (22:08 +0000)
committerArt4 <art4@wlabs.de>
Sat, 7 Dec 2024 22:08:59 +0000 (22:08 +0000)
curweather/curweather.php
js_upload/file-uploader/server/php.php
membersince/membersince.php

index 9aa8584a3f7f5f5d0b04da7ab6f7ddce9321dc54..e5e2710da291b9cb4a65609e08c73723844546bc 100644 (file)
@@ -29,10 +29,10 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
        $now = new DateTime();
 
        if (!is_null($cached)) {
-               $cdate = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
+               $cdate = (int) DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
                $cached = unserialize($cached);
 
-               if ($cdate + $cachetime > $now->getTimestamp()) {
+               if ($cdate + (int) $cachetime > $now->getTimestamp()) {
                        return $cached;
                }
        }
index 2248c8f097a06b3c4cec84fd06734b7317db7348..ff485deca165b0cb42fc394e36eec119f68ce080 100644 (file)
@@ -77,10 +77,10 @@ class qqFileUploader {
        public function __construct(array $allowedExtensions = [], $sizeLimit = 10485760)
        {
                $allowedExtensions = array_map('strtolower', $allowedExtensions);
-                       
+
                $this->allowedExtensions = $allowedExtensions;
                $this->sizeLimit = $sizeLimit;
-               
+
                $this->checkServerSettings();
 
                if (isset($_GET['qqfile'])) {
@@ -88,7 +88,7 @@ class qqFileUploader {
                } elseif (isset($_FILES['qqfile'])) {
                        $this->file = new qqUploadedFileForm();
                } else {
-                       $this->file = false; 
+                       $this->file = false;
                }
        }
 
@@ -105,7 +105,7 @@ class qqFileUploader {
 
        private function toBytes(string $str): int
        {
-               $val = trim($str);
+               $val = (int) trim($str);
                $last = strtolower($str[strlen($str) - 1]);
 
                switch($last) {
index f8128eb705c428582453e1bf57809fff275765b0..20e41ac978b98077e1da95e17702673bc5ae7bb0 100644 (file)
@@ -7,7 +7,6 @@
  * Status: Unsupported
  */
 
-use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\DI;
 use Friendica\Util\DateTimeFormat;
@@ -19,7 +18,7 @@ function membersince_install()
 
 function membersince_display(array &$b)
 {
-       if (DI::app()->getCurrentTheme() == 'frio') {
+       if (DI::appHelper()->getCurrentTheme() == 'frio') {
                // Works in Frio.
                $doc = new DOMDocument();
                $doc->loadHTML(mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8'));
@@ -39,7 +38,7 @@ function membersince_display(array &$b)
                $label->setAttribute('class', 'col-lg-4 col-md-4 col-sm-4 col-xs-12 profile-label-name text-muted');
 
                // The div for the register date of the profile owner.
-               $entry = $doc->createElement('div', DateTimeFormat::local(DI::app()->profile['register_date']));
+               $entry = $doc->createElement('div', DateTimeFormat::local(DI::appHelper()->profile['register_date']));
                $entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry');
 
                $div->appendChild($hr);
@@ -50,6 +49,6 @@ function membersince_display(array &$b)
                $b = $doc->saveHTML();
        } else {
                // Works in Vier.
-               $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local(DI::app()->profile['register_date']) . "</dd>\n</dl>", $b, 1);
+               $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . DI::l10n()->t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local(DI::appHelper()->profile['register_date']) . "</dd>\n</dl>", $b, 1);
        }
 }