Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 19, 2019

all functions that take encoding option use php.internal_encoding as default (e.g. htmlentities/mb_strlen/mb_regex/etc)

Note: The new sniff will only throw an error when the testVersion indicates that both PHP < 5.6 as well as PHP 5.6+ need to be supported.

Refs:

Includes unit tests.

Fixes #839

Notes

This PR does not address the mb_erg..() functions. For those to work correctly cross-version the encoding needs to be set using the mb_regex_encoding() function.
As PHPCS cannot determine whether this has already been done in another file/scope, sniffing for this would yield too many false positives.

@jrfnl jrfnl added this to the 9.3.0 milestone Aug 19, 2019
@jrfnl jrfnl requested a review from wimg August 19, 2019 18:34
@jrfnl jrfnl force-pushed the php-5.6/839-new-default-charset-sniff branch from f0d26ae to 8ec742f Compare August 21, 2019 05:10
> all functions that take encoding option use php.internal_encoding as default (e.g. htmlentities/mb_strlen/mb_regex/etc)

**Note**:  The new sniff will only throw an error when the `testVersion` indicates that both PHP < 5.6 as well as PHP 5.6+ need to be supported.

Refs:
* https://wiki.php.net/rfc/default_encoding
* https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.default-encoding
* https://www.php.net/manual/en/migration56.deprecated.php#migration56.deprecated.iconv-mbstring-encoding

Includes unit tests.

Fixes 839
@jrfnl jrfnl force-pushed the php-5.6/839-new-default-charset-sniff branch from 8ec742f to ee2b1ea Compare August 21, 2019 11:24
@wimg wimg merged commit 4c76a85 into master Aug 28, 2019
@delete-merged-branch delete-merged-branch bot deleted the php-5.6/839-new-default-charset-sniff branch August 28, 2019 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.