From 9de7a88f9ad65526f8703675cb65dc17fad86ced Mon Sep 17 00:00:00 2001
From: ruan <2369127-ruany@users.noreply.gitlab.com>
Date: Thu, 30 Dec 2021 11:20:12 +0200
Subject: [PATCH] Update extension checks
---
error/missing-extensions.php | 7 +++++--
inc/init.php | 2 +-
inc/page.php | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/error/missing-extensions.php b/error/missing-extensions.php
index d6c2864..ecc0b3b 100644
--- a/error/missing-extensions.php
+++ b/error/missing-extensions.php
@@ -14,8 +14,11 @@
The following PHP extensions are required by litebans-php but were not found:
- pdo_mysql
";
+ $ext
";
+ }
}
$phpini = php_ini_loaded_file();
diff --git a/inc/init.php b/inc/init.php
index 5b47dbc..df3540b 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -7,6 +7,6 @@ function redirect($url, $showtext = true) {
die("");
}
-if (!extension_loaded("pdo_mysql")) {
+if (!extension_loaded("pdo_mysql") || !extension_loaded("intl")) {
redirect("error/missing-extensions.php");
}
diff --git a/inc/page.php b/inc/page.php
index bbd9740..76c7ea3 100644
--- a/inc/page.php
+++ b/inc/page.php
@@ -22,7 +22,7 @@ class Page {
$this->lang = new en_US();
}
- $this->formatter = new IntlDateFormatter($settings->lang, IntlDateFormatter::LONG, IntlDateFormatter::NONE, $this->settings->timezone, IntlDateFormatter::GREGORIAN, $settings->date_format);
+ $this->formatter = new IntlDateFormatter($settings->lang, IntlDateFormatter::LONG, IntlDateFormatter::NONE, $settings->timezone, IntlDateFormatter::GREGORIAN, $settings->date_format);
$this->conn = $settings->conn;
$this->settings = $settings;