]> git.mxchange.org Git - friendica.git/blobdiff - mod/view.php
Merge pull request #7039 from annando/api-reshare-quote
[friendica.git] / mod / view.php
index 33aa23f44751c2c809bd49b1f244cd5952609cbf..6f23d84dc45f776627578a8f5413f528cbfaadad 100644 (file)
@@ -1,16 +1,27 @@
 <?php
+
+use Friendica\App;
+use Friendica\Util\Strings;
+
 /**
- * load view/theme/$current_theme/style.php with friendica contex
+ * load view/theme/$current_theme/style.php with friendica context
+ *
+ * @param App $a
  */
-function view_init($a){
+function view_init(App $a)
+{
        header("Content-Type: text/css");
-               
-       if ($a->argc == 4){
+
+       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";
-               require_once("view/theme/$theme/style.php");
+               if (file_exists("view/theme/$theme/style.php")) {
+                       require_once("view/theme/$theme/style.php");
+               }
        }
-       
-       killme();
+
+       exit();
 }