<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\DI;
+use Friendica\Core\System;
use Friendica\Util\Strings;
/**
*/
class Theme extends BaseModule
{
- public static function rawContent(array $parameters = [])
+ protected function rawContent(array $request = [])
{
- header("Content-Type: text/css");
+ header('Content-Type: text/css');
- $a = DI::app();
+ $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
- if ($a->argc == 4) {
- $theme = $a->argv[2];
- $theme = Strings::sanitizeFilePathItem($theme);
-
- // set the path for later use in the theme styles
- $THEMEPATH = "view/theme/$theme";
- if (file_exists("view/theme/$theme/style.php")) {
- require_once("view/theme/$theme/style.php");
- }
+ if (file_exists("view/theme/$theme/theme.php")) {
+ require_once "view/theme/$theme/theme.php";
}
- exit();
+ // set the path for later use in the theme styles
+ $THEMEPATH = "view/theme/$theme";
+ if (file_exists("view/theme/$theme/style.php")) {
+ require_once "view/theme/$theme/style.php";
+ }
+ System::exit();
}
}