From fa99a735cd23918bab95baaf13b7a3142946d4b2 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Wed, 5 Jun 2024 00:15:31 +0200 Subject: [PATCH] feat: frequency is now up to 366 feat: change filename of backup file fix: translate: "no category" fix: trim fixer api key fix: add webp support to gd on the container fix: update slovanian translations --- Dockerfile | 4 ++-- endpoints/currency/fixer_api_key.php | 2 +- includes/getdbkeys.php | 7 ++----- includes/version.php | 2 +- index.php | 15 +++++++++------ scripts/admin.js | 9 ++++++++- stats.php | 5 ++++- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e281b9..f68c8b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,10 @@ WORKDIR /var/www/html # Update packages and install dependencies RUN apk upgrade --no-cache && \ - apk add --no-cache sqlite-dev libpng libpng-dev libjpeg-turbo libjpeg-turbo-dev freetype freetype-dev curl autoconf libgomp icu-dev nginx dcron tzdata imagemagick imagemagick-dev libzip-dev sqlite && \ + apk add --no-cache sqlite-dev libpng libpng-dev libjpeg-turbo libjpeg-turbo-dev freetype freetype-dev curl autoconf libgomp icu-dev nginx dcron tzdata imagemagick imagemagick-dev libzip-dev sqlite libwebp-dev && \ docker-php-ext-install pdo pdo_sqlite && \ docker-php-ext-enable pdo pdo_sqlite && \ - docker-php-ext-configure gd --with-freetype --with-jpeg && \ + docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \ docker-php-ext-install -j$(nproc) gd intl zip && \ apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \ pecl install imagick && \ diff --git a/endpoints/currency/fixer_api_key.php b/endpoints/currency/fixer_api_key.php index 90a5ec7..10f301a 100644 --- a/endpoints/currency/fixer_api_key.php +++ b/endpoints/currency/fixer_api_key.php @@ -3,7 +3,7 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) { if ($_SERVER["REQUEST_METHOD"] === "POST") { - $newApiKey = isset($_POST["api_key"]) ? $_POST["api_key"] : ""; + $newApiKey = isset($_POST["api_key"]) ? trim($_POST["api_key"]) : ""; $provider = isset($_POST["provider"]) ? $_POST["provider"] : 0; $removeOldKey = "DELETE FROM fixer WHERE user_id = :userId"; diff --git a/includes/getdbkeys.php b/includes/getdbkeys.php index 4c1a6ce..2130024 100644 --- a/includes/getdbkeys.php +++ b/includes/getdbkeys.php @@ -49,11 +49,8 @@ } $frequencies = array(); - $query = "SELECT * FROM frequencies"; - $result = $db->query($query); - while ($row = $result->fetchArray(SQLITE3_ASSOC)) { - $frequencyId = $row['id']; - $frequencies[$frequencyId] = $row; + for ($i = 1; $i <= 366; $i++) { + $frequencies[$i] = array('id' => $i, 'name' => $i); } ?> \ No newline at end of file diff --git a/includes/version.php b/includes/version.php index cbed1a6..fc6d2d3 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ diff --git a/index.php b/index.php index ec606e5..429ca24 100644 --- a/index.php +++ b/index.php @@ -83,6 +83,9 @@