From 04ea85aa5df340e4dfcfa5b9d40b7e79706d08a0 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 29 Oct 2024 15:06:21 -0400 Subject: [PATCH] Fixed issue where if global $argv is not available, a check to see if `$_SERVER['argv']` is set before accessing it due to a potential 'undefined' error. --- CHANGELOG.md | 9 +++++++++ project.json | 2 +- src/OptsLib/Parse.php | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 908d29f..cdad2b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.3] - 2024-10-29 + +This update introduces a critical bug fix + +### Fixed + - Fixed issue where if global $argv is not available, a check to see if `$_SERVER['argv']` is set + before accessing it due to a potential 'undefined' error. + + ## [1.1.2] - 2024-10-13 Updated Build System diff --git a/project.json b/project.json index 34462ac..0a51542 100644 --- a/project.json +++ b/project.json @@ -20,7 +20,7 @@ "package": "net.nosial.optslib", "description": "A simple options parser library for PHP", "copyright": "Copyright (c) 2022-2023 Nosial", - "version": "1.1.2", + "version": "1.1.3", "uuid": "20aefdfa-7b91-11ed-919f-cb63712c8e36" }, "build": { diff --git a/src/OptsLib/Parse.php b/src/OptsLib/Parse.php index 6c40a75..4b56297 100644 --- a/src/OptsLib/Parse.php +++ b/src/OptsLib/Parse.php @@ -117,7 +117,7 @@ { global $argv; - if($argv === null) + if($argv === null && isset($_SERVER['argv'])) { $argv = $_SERVER['argv']; }