Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal character warning from iconv #184

Open
nikic opened this issue Dec 25, 2019 · 1 comment
Open

Illegal character warning from iconv #184

nikic opened this issue Dec 25, 2019 · 1 comment

Comments

@nikic
Copy link

nikic commented Dec 25, 2019

Parsing the input @\Afffff produces an "illegal character" warning from iconv. Possibly this just needs to be suppressed or converted into an exception?

#1 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parsing/ParserState.php(96): iconv('utf-32le', 'utf-8', '\xFF\xFF\xAF\x00')
#2 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parsing/ParserState.php(52): Sabberworm\CSS\Parsing\ParserState->parseCharacter(true)
#3 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(107): Sabberworm\CSS\Parsing\ParserState->parseIdentifier()
#4 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(75): Sabberworm\CSS\CSSList\CSSList::parseAtRule(Object(Sabberworm\CSS\Parsing\ParserState))
#5 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php(50): Sabberworm\CSS\CSSList\CSSList::parseListItem(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#6 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/Document.php(21): Sabberworm\CSS\CSSList\CSSList::parseList(Object(Sabberworm\CSS\Parsing\ParserState), Object(Sabberworm\CSS\CSSList\Document))
#7 /home/nikic/PHP-Fuzzer/example/PHP-CSS-Parser/lib/Sabberworm/CSS/Parser.php(38): Sabberworm\CSS\CSSList\Document::parse(Object(Sabberworm\CSS\Parsing\ParserState))
#8 /home/nikic/PHP-Fuzzer/example/target_css_parser.php(9): Sabberworm\CSS\Parser->parse()
@EMDM45
Copy link

EMDM45 commented Feb 4, 2020

I have the similar problem with iconv:

[2020-02-04 09:39:11] (WARN @ /web/core/components/minifyx/vendor/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/ParserState.php : 96)
PHP notice: iconv(): Wrong charset, conversion from `utf-32le' to `utf-8' is not allowed
.css:before {content: "";}

My code:

$parser = new Sabberworm\CSS\Parser('.css:before{content:"\f934"}');
$document = $parser->parse();
echo $document->render();

\f934 - this is unicode from FontAwesome;
PHP Version 7.1.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants