[wp-trac] [WordPress Trac] #56980: Check that the Normalizer class exists in remove_accents()

WordPress Trac noreply at wordpress.org
Thu Nov 3 14:28:40 UTC 2022


#56980: Check that the Normalizer class exists in remove_accents()
----------------------------+---------------------
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  6.1.1
Component:  Formatting      |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+---------------------

Comment (by SergeyBiryukov):

 Replying to [comment:1 mukesh27]:
 > We need both class to be exist? or any one?

 Both the `normalizer_normalize()` function and the `Normalizer::FORM_C`
 class property are used in the affected code, so I think we should check
 if both are available.

 Replying to [comment:4 hellofromTonya]:
 > Is there a case where Core should allow for the polyfill's version to be
 used?

 Good question! Maybe, but I'm not sure it's possible.

 See the UpdraftPlus plugin for example, which
 [https://plugins.trac.wordpress.org/browser/updraftplus/tags/1.22.23/vendor/symfony
 /polyfill-intl-normalizer/bootstrap.php#L12 uses the Symfony polyfill for
 Normalizer], but the Normalizer class has a different namespace there,
 `p\Normalizer`, so `Normalizer::FORM_C` produces a fatal error.

 How do we get the correct `Normalizer::FORM_C` value in that case? Should
 we also check for `p\Normalizer`?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56980#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list