From 9cee55c05a266961d80bc8970fff20d6a840fcb3 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Mon, 19 Jan 2026 10:04:47 +0700 Subject: [PATCH] chore: bump version to v1.2.1 --- .gitignore | 3 ++- app/Config/SiteConfig.php | 2 +- app/Core/Router.php | 14 ++++++++++---- app/Helpers/LanguageHelper.php | 2 +- app/Views/layouts/footer_main.php | 2 +- app/Views/layouts/footer_public.php | 2 +- app/Views/layouts/navbar_main.php | 9 ++++++--- app/Views/layouts/sidebar_session.php | 2 +- package.json | 2 +- public/assets/js/modules/i18n.js | 6 ++++-- public/lang/en.json | 2 +- routes/web.php | 4 ++++ 12 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 742d264..2e3f964 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,5 @@ deploy.ps1 !/public/uploads/.gitignore # Plugins -/plugins/* \ No newline at end of file +/plugins/* +!/plugins/.gitkeep \ No newline at end of file diff --git a/app/Config/SiteConfig.php b/app/Config/SiteConfig.php index 9b98f4c..23900b4 100644 --- a/app/Config/SiteConfig.php +++ b/app/Config/SiteConfig.php @@ -3,7 +3,7 @@ namespace App\Config; class SiteConfig { const APP_NAME = 'MIVO'; - const APP_VERSION = 'v1.2.0'; + const APP_VERSION = 'v1.2.1'; const APP_FULL_NAME = 'MIVO - Mikrotik Voucher'; const CREDIT_NAME = 'MivoDev'; const CREDIT_URL = 'https://github.com/mivodev'; diff --git a/app/Core/Router.php b/app/Core/Router.php index a277032..e894311 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -97,10 +97,16 @@ class Router { $path = parse_url($uri, PHP_URL_PATH); - // Handle subdirectory - $scriptName = dirname($_SERVER['SCRIPT_NAME']); - if (strpos($path, $scriptName) === 0) { - $path = substr($path, strlen($scriptName)); + // Handle subdirectory (SKIP for PHP Built-in Server to avoid SCRIPT_NAME issues) + if (php_sapi_name() !== 'cli-server') { + $scriptName = dirname($_SERVER['SCRIPT_NAME']); + // Normalize backslashes (Windows) + $scriptName = str_replace('\\', '/', $scriptName); + + // Ensure we don't strip root slash + if ($scriptName !== '/' && strpos($path, $scriptName) === 0) { + $path = substr($path, strlen($scriptName)); + } } $path = $this->normalizePath($path); diff --git a/app/Helpers/LanguageHelper.php b/app/Helpers/LanguageHelper.php index cc2fec0..01514c8 100644 --- a/app/Helpers/LanguageHelper.php +++ b/app/Helpers/LanguageHelper.php @@ -40,6 +40,6 @@ class LanguageHelper } } - return $languages; + return \App\Core\Hooks::applyFilters('get_available_languages', $languages); } } diff --git a/app/Views/layouts/footer_main.php b/app/Views/layouts/footer_main.php index c551f8d..13ca5a5 100644 --- a/app/Views/layouts/footer_main.php +++ b/app/Views/layouts/footer_main.php @@ -13,7 +13,7 @@ Docs - + Community diff --git a/app/Views/layouts/footer_public.php b/app/Views/layouts/footer_public.php index b85ebfe..08b5cf6 100644 --- a/app/Views/layouts/footer_public.php +++ b/app/Views/layouts/footer_public.php @@ -4,7 +4,7 @@ Docs - + Community diff --git a/app/Views/layouts/navbar_main.php b/app/Views/layouts/navbar_main.php index c256820..ddb1980 100644 --- a/app/Views/layouts/navbar_main.php +++ b/app/Views/layouts/navbar_main.php @@ -53,8 +53,9 @@ $uri = $_SERVER['REQUEST_URI'] ?? '/'; - @@ -123,8 +124,10 @@ $uri = $_SERVER['REQUEST_URI'] ?? '/'; Select Language
- - diff --git a/app/Views/layouts/sidebar_session.php b/app/Views/layouts/sidebar_session.php index c650017..d55dcc0 100644 --- a/app/Views/layouts/sidebar_session.php +++ b/app/Views/layouts/sidebar_session.php @@ -397,7 +397,7 @@ $getInitials = function($name) { - + Community diff --git a/package.json b/package.json index 89de478..fe65819 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mivo", - "version": "1.2.0", + "version": "1.2.1", "description": "This is a complete rewrite of Mivo using a modern MVC architecture.\r It runs on a lightweight custom core designed for performance on low-end devices (STB/Android).", "main": "index.js", "scripts": { diff --git a/public/assets/js/modules/i18n.js b/public/assets/js/modules/i18n.js index 1e70aa8..674df54 100644 --- a/public/assets/js/modules/i18n.js +++ b/public/assets/js/modules/i18n.js @@ -19,10 +19,12 @@ class I18n { this.isLoaded = true; } - async loadLanguage(lang) { + async loadLanguage(lang, customUrl = null) { try { const cacheBuster = Date.now(); - const response = await fetch(`/lang/${lang}.json?v=${cacheBuster}`); + // Use custom URL if provided, otherwise default to public/lang structure + const url = customUrl || `/lang/${lang}.json`; + const response = await fetch(`${url}?v=${cacheBuster}`); if (!response.ok) throw new Error(`Failed to load language: ${lang}`); this.translations = await response.json(); diff --git a/public/lang/en.json b/public/lang/en.json index 6f400fd..6355dde 100644 --- a/public/lang/en.json +++ b/public/lang/en.json @@ -1,7 +1,7 @@ { "_meta": { "name": "English", - "flag": "gb" + "flag": "us" }, "common": { "dashboard": "Dashboard", diff --git a/routes/web.php b/routes/web.php index ddc7250..429ca2a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,6 +39,10 @@ $router->group(['middleware' => 'router.valid'], function($router) { // Temporary Test Route $router->get('/test-alert', [HomeController::class, 'testAlert']); +// Plugin Language Route - DEPRECATED +// Plugins now handle their own routing via Hooks::addAction('router_init') + + // ----------------------------------------------------------------------------- // Protected Admin Routes (Requires Auth)