Commit 4964e8e9 authored by Henning Leutz's avatar Henning Leutz 🥋

Issue #148 .htaccess Generator

globale Konstante QUIQQER_SYSTEM
jede PHP Datei die direkt aufgerufen werden kann, muss diese Konstante besitzen
parent 483a08e5
Pipeline #87 skipped
......@@ -5,6 +5,7 @@
*/
define('QUIQQER_AJAX', true);
define('QUIQQER_SYSTEM', true);
require_once 'header.php';
......
<?php
define('QUIQQER_SYSTEM', true);
require 'header.php';
// qui path
......
......@@ -15,6 +15,10 @@
* it includes the header file
*/
if (!defined('QUIQQER_SYSTEM')) {
exit;
}
if (!defined('ETC_DIR')) {
require_once 'quiqqer.php';
exit;
......
<?php
define('QUIQQER_SYSTEM', true);
require_once 'bootstrap.php';
if (!isset($_REQUEST['project']) || !isset($_REQUEST['id'])) {
......
<?php
error_reporting(E_ALL);
define('QUIQQER_SYSTEM', true);
/**
* @author www.pcsg.com (Henning Leutz)
......@@ -34,7 +35,7 @@ try {
// UTF 8 Prüfung für umlaute in url
if (isset($_REQUEST['_url'])) {
$_REQUEST['_url'] = QUI\Utils\String::toUTF8($_REQUEST['_url']);
$_REQUEST['_url'] = QUI\Utils\StringHelper::toUTF8($_REQUEST['_url']);
}
//\QUI\Utils\System\Debug::$run = true;
......
......@@ -322,7 +322,7 @@ class Utils
$img = '<img ';
foreach ($attributes as $key => $value) {
$img .= $key . '="' . $value . '" ';
$img .= htmlspecialchars($key) . '="' . htmlspecialchars($value) . '" ';
}
// responsive image
......@@ -344,7 +344,7 @@ class Utils
// $img .= ' srcset="'. implode(",\n", $srcset) .'"';
// }
$img .= ' src="' . $src . '" />';
$img .= ' src="' . htmlspecialchars($src) . '" />';
return $img;
}
......
......@@ -1338,6 +1338,8 @@ class Rewrite
$att['title'] = $Image->getAttribute('title')
? $Image->getAttribute('title') : '';
$att['data-src'] = $Image->getSizeCacheUrl();
} catch (QUI\Exception $Exception) {
}
}
......
......@@ -213,22 +213,19 @@ if (file_exists(\$boot)) {
file_put_contents(
$image,
$fileHeader.
"require 'bootstrap.php';\n".
"require '{$OPT_DIR}quiqqer/quiqqer/image.php';"
"require '{$OPT_DIR}quiqqer/quiqqer/image.php';\n"
);
file_put_contents(
$index,
$fileHeader.
"require 'bootstrap.php';\n".
"require '{$OPT_DIR}quiqqer/quiqqer/index.php';"
"require '{$OPT_DIR}quiqqer/quiqqer/index.php';\n"
);
file_put_contents(
$quiqqer,
$fileHeader.
"require 'bootstrap.php';\n".
"require '{$OPT_DIR}quiqqer/quiqqer/quiqqer.php';"
"require '{$OPT_DIR}quiqqer/quiqqer/quiqqer.php';\n"
);
}
}
......@@ -140,9 +140,25 @@ class Htaccess extends QUI\System\Console\Tool
RewriteRule ^{$URL_SYS_ADMIN_DIR}$ /{$URL_SYS_DIR} [R=301,L]
RewriteRule ^{$URL_BIN_DIR}(.*)$ {$quiqqerBin}/$1 [L]
RewriteRule ^{$URL_LIB_DIR}(.*)$ {$quiqqerLib}/$1 [L]
RewriteRule ^{$URL_SYS_DIR}(.*)$ {$quiqqerSys}/$1 [L]
## bin dir
RewriteRule \"^bin/(.*)$\" \"{$quiqqerBin}/$1\" [L]
## lib dir
RewriteCond \"%{REQUEST_URI}\" \"^.*bin/\"
RewriteRule \"^{$URL_LIB_DIR}(.*)$\" \"{$quiqqerLib}/$1\" [L]
## admin
RewriteCond \"%{REQUEST_URI}\" \"^/{$URL_SYS_DIR}\" [or]
RewriteCond \"%{REQUEST_URI}\" \"^/{$URL_SYS_DIR}index.php\" [or]
RewriteCond \"%{REQUEST_URI}\" \"^/{$URL_SYS_DIR}image.php\" [or]
RewriteCond \"%{REQUEST_URI}\" \"^/{$URL_SYS_DIR}ajax.php\"
RewriteRule \"^{$URL_SYS_DIR}(.*)$\" \"{$quiqqerSys}/$1\" [L]
# quiqqer API allowed requests
#RewriteRule ^{$URL_BIN_DIR}(.*)$ {$quiqqerBin}/$1 [L]
#RewriteRule ^{$URL_LIB_DIR}(.*)$ {$quiqqerLib}/$1 [L]
#RewriteRule ^{$URL_SYS_DIR}(.*)$ {$quiqqerSys}/$1 [L]
RewriteCond %{REQUEST_FILENAME} !^.*bin/
RewriteRule ^.*{$URL_VAR_DIR}|^.*media/sites/ {$URL_DIR} [L]
......
......@@ -3,7 +3,7 @@
/**
* This file contains the quiqqer access for the api, cron and console
*/
define('QUIQQER_SYSTEM', true);
require 'bootstrap.php';
// no console
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment