Bug #79110 [NEW]: php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS)

From: Date: Mon, 13 Jan 2020 14:51:36 +0000
Subject: Bug #79110 [NEW]: php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224880@lists.php.net to get a copy of this message
From: a at ustimen dot co Operating system: Any EBCDIC-aware PHP version: Irrelevant Package: *URL Functions Bug Type: Bug Bug description:php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS) Description: ------------ https://github.com/php/php-src/blob/8ee04946f0d80ad6c77e707e36f53939e3932c7d/ext/standard/url.c#L586 Bug is 21 years old. - if (!isalnum(c) && strchr("_-.~", c) != NULL) { + if (!isalnum(c) && strchr("_-.~", c) == NULL) { Test script: --------------- # Compile PHP under not CHARSET_EBCDIC # Run php -r 'var_dump(rawurlencode("<tag-here />"));' Command line code:1: string(20) "%3Ctag-here%20%2F%3E" # Compile PHP under CHARSET_EBCDIC # Run php -r 'var_dump(rawurlencode("<tag-here />"));' # It ALSO should output: Command line code:1: string(20) "%3Ctag-here%20%2F%3E" # But I propose it will output: Command line code:1: string(14) "<tag%2dhere />" -- Edit bug report at https://bugs.php.net/bug.php?id=79110&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79110&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79110&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79110&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79110&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79110&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79110&r=support Expected behavior: https://bugs.php.net/fix.php?id=79110&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79110&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79110&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79110&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79110&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79110&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79110&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79110&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79110&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79110&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79110&r=mysqlcfg

« previous php.bugs (#224880) next »