]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/vier/style.php
Move Config::get() to DI::config()->get()
[friendica.git] / view / theme / vier / style.php
index d777864825a11cf98b2aeb1d692ab1567b44d7b4..9231a9016ecc7840af3ada452f12311a608028c0 100644 (file)
@@ -2,16 +2,16 @@
 /**
  * @file view/theme/vier/style.php
  */
+use Friendica\Core\Logger;
 use Friendica\Core\Config;
-use Friendica\Core\PConfig;
-use Friendica\Model\Profile;
+use Friendica\DI;
 
-$uid = Profile::getThemeUid();
+$uid = $_REQUEST['puid'] ?? 0;
 
-$style = PConfig::get($uid, 'vier', 'style');
+$style = DI::pConfig()->get($uid, 'vier', 'style');
 
 if (empty($style)) {
-       $style = Config::get('vier', 'style');
+       $style = DI::config()->get('vier', 'style');
 }
 
 if (empty($style)) {
@@ -21,6 +21,8 @@ if (empty($style)) {
 $stylecss = '';
 $modified = '';
 
+$style = \Friendica\Util\Strings::sanitizeFilePathItem($style);
+
 foreach (['style', $style] as $file) {
        $stylecssfile = $THEMEPATH . DIRECTORY_SEPARATOR . $file .'.css';
        if (file_exists($stylecssfile)) {
@@ -30,8 +32,8 @@ foreach (['style', $style] as $file) {
                        $modified = $stylemodified;
                }
        } else {
-               //TODO: use LOGGER_ERROR?
-               logger('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')');
+               //TODO: use Logger::ERROR?
+               Logger::log('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')');
        }
 }
 $modified = gmdate('r', $modified);