- Issue created by @prudloff
- ๐ฎ๐ณIndia Vivek Panicker Kolkata
@prudloff Question: The method expects a CSS identifier as argument. Why are we passing the output of
file_get_contents()
? - ๐ซ๐ทFrance prudloff Lille
The file contains an example of a bogus unicode string that can be used to reproduce the deprecation.
I tried to paste the content directly in my PHP example, but it would lose some of the buggy invisible characters. - gaurav gupta Jaipur, Rajasthsan
Hi @prudloff i am trying to reproduce the issue in php8.3 but failed to do so.
I have provided the attatchment . - ๐ซ๐ทFrance prudloff Lille
Is your PHP configured to display/log deprecations?
If I try to reproduce with
drush php-eval
, it seems I need to call it with-v
to see the deprecation. - gaurav gupta Jaipur, Rajasthsan
@prudloff i can only see error when i am providing $content=null
- ๐ซ๐ทFrance prudloff Lille
Here is an easier way to reproduce:
\Drupal\Component\Utility\Html::cleanCssIdentifier("\x80\x81");
- Merge request !7758Issue #3442829: Solve deprecated function error. โ (Open) created by gaurav gupta
- Status changed to Needs review
12 months ago 5:58am 26 April 2024 - ๐ฎ๐ณIndia Binoli Lalani Gujarat
Binoli Lalani โ made their first commit to this issueโs fork.
- ๐ฎ๐ณIndia Binoli Lalani Gujarat
Hello,
I have added test coverage for this PHP deprecation error along with this error fix. Please review.
Thank you!
- Status changed to Needs work
11 months ago 1:48pm 26 April 2024 - ๐บ๐ธUnited States smustgrave
Should find where null is being passed in. This change could be masking a larger issue.
- gaurav gupta Jaipur, Rajasthsan
Hi @smustgrave ,
In this particular situation error is coming after line 127 , in this when using preg_replace function it is stripping of all the character which are not in the list and that 's why it is getting null. - ๐ซ๐ทFrance prudloff Lille
@smustgrave preg_replace() returns null when an error occurred.
Here the first preg_replace() call in cleanCssIdentifier() fails with this:Malformed UTF-8 characters, possibly incorrectly encoded
- ๐บ๐ธUnited States smustgrave
Thanks @prudloff, think the rest is fine then.
- ๐ณ๐ฟNew Zealand quietone
And this needs a better title. The title should be a description of what is being fixed or improved. The title is used as the git commit message so it should be meaningful and concise. See List of issue fields โ .
- ๐ซ๐ทFrance prudloff Lille
Would that be a better title?
See the comments in the MR
I don't see any comment on the MR.