diff --git a/.drone.yml b/.drone.yml
index 8dc4c05e..87d1a304 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -72,7 +72,7 @@ steps:
- php /tmp/ci/composer install
- php bin/cli.php migrate
- php bin/cli.php theme install crisp
- - vendor/bin/twig-linter lint themes/crisp/templates/
+# - vendor/bin/twig-linter lint themes/crisp/templates/
# - vendor/bin/phpunit tests --bootstrap pixelcatproductions/crisp.php
- rm /tmp/ci/composer
diff --git a/composer.json b/composer.json
index 052a3788..912445b3 100644
--- a/composer.json
+++ b/composer.json
@@ -13,7 +13,6 @@
"phpmailer/phpmailer": "^6.4"
},
"require-dev": {
- "phpunit/phpunit": "9",
- "sserbin/twig-linter": "@dev"
+ "phpunit/phpunit": "^9.5"
}
}
diff --git a/pixelcatproductions/class/crisp/api/Helper.php b/pixelcatproductions/class/crisp/api/Helper.php
index ac07e5ec..b062767d 100644
--- a/pixelcatproductions/class/crisp/api/Helper.php
+++ b/pixelcatproductions/class/crisp/api/Helper.php
@@ -45,7 +45,6 @@ public static function hasApiPermissions($BitmaskFlag) {
$keyDetails = self::getAPIKeyDetails($apikey);
-
if (!$keyDetails) {
return false;
}
@@ -63,7 +62,6 @@ public static function getAPIKeyDetails($ApiKey) {
$statement->execute([":key" => $ApiKey]);
-
if ($statement->rowCount() > 0) {
return $statement->fetch(\PDO::FETCH_ASSOC);
}
@@ -85,7 +83,6 @@ public static function getAPIKey() {
}
$statement->execute([":key" => $apikey]);
-
if ($statement->rowCount() > 0) {
return true;
}
@@ -121,7 +118,7 @@ public static function getLocale() {
}
- if (!in_array($Locale, array_keys(array_column(\crisp\api\lists\Languages::fetchLanguages(false), null, "Code")))) {
+ if (!in_array($Locale, array_keys(array_column(\crisp\api\lists\Languages::fetchLanguages(false), null, "code")))) {
$Locale = "en";
}
diff --git a/pixelcatproductions/crisp.php b/pixelcatproductions/crisp.php
index d7cea940..aeb9c66d 100644
--- a/pixelcatproductions/crisp.php
+++ b/pixelcatproductions/crisp.php
@@ -27,7 +27,7 @@
class core {
/* Some important constants */
- const CRISP_VERSION = "2.0.0";
+ const CRISP_VERSION = "3.0.0";
/**
* This is my autoloader.
@@ -47,7 +47,6 @@ public static function bootstrap() {
spl_autoload_register(function ($class) {
$file = __DIR__ . "/class/" . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
-
if (file_exists($file)) {
require $file;
return true;
@@ -80,10 +79,8 @@ public static function bootstrap() {
$GLOBALS['navbar_right'] = array();
$GLOBALS["render"] = array();
-
session_start();
-
$CurrentTheme = \crisp\api\Config::get("theme");
$CurrentFile = substr(substr($_SERVER['PHP_SELF'], 1), 0, -4);
$CurrentPage = $GLOBALS["route"]->Page;
@@ -100,7 +97,6 @@ public static function bootstrap() {
define("CURRENT_UNIVERSE", Universe::getUniverse($_COOKIE[core\Config::$Cookie_Prefix . "universe"]));
define("CURRENT_UNIVERSE_NAME", Universe::getUniverseName(CURRENT_UNIVERSE));
-
$ThemeLoader = new \Twig\Loader\FilesystemLoader(array(__DIR__ . "/../themes/$CurrentTheme/templates/", __DIR__ . "/../plugins/"));
$TwigTheme;
@@ -165,7 +161,6 @@ public static function bootstrap() {
$TwigTheme->addFunction(new \Twig\TwigFunction('includeResource', [new \crisp\core\Themes(), 'includeResource']));
$TwigTheme->addFunction(new \Twig\TwigFunction('generateLink', [new \crisp\api\Helper(), 'generateLink']));
-
$Translation = new \crisp\api\Translation($Locale);
$TwigTheme->addFilter(new \Twig\TwigFilter('date', 'date'));
@@ -179,10 +174,8 @@ public static function bootstrap() {
$TwigTheme->addFilter(new \Twig\TwigFilter('getlang', [new \crisp\api\lists\Languages(), 'getLanguageByCode']));
$TwigTheme->addFilter(new \Twig\TwigFilter('truncateText', [new \crisp\api\Helper(), 'truncateText']));
-
$EnvFile = parse_ini_file(__DIR__ . "/../.env");
-
$RedisClass = new \crisp\core\Redis();
$rateLimiter = new \RateLimit\RedisRateLimiter($RedisClass->getDBConnector());
@@ -194,7 +187,6 @@ public static function bootstrap() {
header('Access-Control-Allow-Origin: *');
header("Cache-Control: max-age=600, public, must-revalidate");
-
if (!isset($_SERVER['HTTP_USER_AGENT']) || empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == "i am not valid") {
http_response_code(403);
echo $TwigTheme->render("errors/nginx/403.twig", ["error_msg" => "Request forbidden by administrative rules. Please make sure your request has a User-Agent header"]);
@@ -214,7 +206,6 @@ public static function bootstrap() {
if (isset(apache_request_headers()["Authorization"])) {
$keyDetails = api\Helper::getAPIKeyDetails(apache_request_headers()["Authorization"]);
-
if ($keyDetails["expires_at"] !== null && strtotime($keyDetails["expires_at"]) < time()) {
header("X-APIKey: expired");
} elseif ($keyDetails["revoked"]) {
@@ -237,13 +228,10 @@ public static function bootstrap() {
$IndicatorHour = "h_" . \crisp\api\Helper::getRealIpAddr();
$IndicatorDay = "d_" . \crisp\api\Helper::getRealIpAddr();
-
$LimitSecond = \RateLimit\Rate::perSecond(15);
$LimitHour = \RateLimit\Rate::perHour(1000);
$LimitDay = \RateLimit\Rate::perHour(15000);
-
-
if (CURRENT_UNIVERSE == \crisp\Universe::UNIVERSE_TOSDR || in_array(\crisp\api\Helper::getRealIpAddr(), \crisp\api\Config::get("office_ips"))) {
$LimitSecond = \RateLimit\Rate::perSecond(15000);
@@ -290,7 +278,6 @@ public static function bootstrap() {
$statusHour = $rateLimiter->limitSilently($IndicatorHour, $LimitHour);
$statusDay = $rateLimiter->limitSilently($IndicatorDay, $LimitDay);
-
header("X-CMS-CDN: " . api\Config::get("cdn"));
header("X-CMS-SHIELDS: " . api\Config::get("shield_cdn"));
header("X-RateLimit-Benefit: " . $Benefit);
@@ -311,8 +298,6 @@ public static function bootstrap() {
core\Themes::loadAPI($TwigTheme, $GLOBALS["route"]->Page, $Query);
core\Plugins::loadAPI($GLOBALS["route"]->Page, $QUERY);
-
-
exit;
}
diff --git a/themes/crisp/includes/about.php b/themes/crisp/includes/about.php
index 8b801a3b..2685bcfd 100644
--- a/themes/crisp/includes/about.php
+++ b/themes/crisp/includes/about.php
@@ -17,6 +17,3 @@
* along with this program. If not, see