From 3f893c1484ec17adf3211fa014f9ef70bdeca837 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 26 Aug 2024 14:04:26 +0200 Subject: [PATCH] Remove an outdated PHP 5.3 check in utils Summary: `parse_ini_string()` has been available since PHP 5.3.0: https://www.php.net/manual/en/function.parse-ini-string.php `INI_SCANNER_RAW` was introduced in PHP 5.3.0 (and received several bug fixes on the way to PHP 5.4.10): https://www.php.net/ChangeLog-5.php Phorge requires PHP 7.2 nowadays; before rP7d8c84a7bdc8fb43674341b97c36c9d8ae1d894a Phorge already required PHP 5.5. Thus remove this outdated check. Test Plan: Read the docs. Reviewers: O1 Blessed Committers, speck Reviewed By: O1 Blessed Committers, speck Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25808 --- src/utils/utils.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/utils/utils.php b/src/utils/utils.php index 58aa9c7a..e7b6d66d 100644 --- a/src/utils/utils.php +++ b/src/utils/utils.php @@ -1449,22 +1449,7 @@ function phutil_ini_decode($string) { $trap = new PhutilErrorTrap(); try { - $have_call = false; - if (function_exists('parse_ini_string')) { - if (defined('INI_SCANNER_RAW')) { - $results = @parse_ini_string($string, true, INI_SCANNER_RAW); - $have_call = true; - } - } - - if (!$have_call) { - throw new PhutilMethodNotImplementedException( - pht( - '%s is not compatible with your version of PHP (%s). This function '. - 'is only supported on PHP versions newer than 5.3.0.', - __FUNCTION__, - phpversion())); - } + $results = @parse_ini_string($string, true, INI_SCANNER_RAW); if ($results === false) { throw new PhutilINIParserException(trim($trap->getErrorsAsString()));