WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 6 months ago

#43668 new defect (bug)

Image cropping fails for many PHP locales, if set

Reported by: knutsp Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: dev-feedback
Focuses: javascript Cc:
PR Number:

Description

If{{{#!php
<?php
setlocale( LC_NUMERIC /*or LC_ALL */, 'nb_NO' );
}}}

is used then Media image cropping fails and selection input fields show Infinity. It works fine with 'en_US', btw.

If #17268 is implemented, I guess it includes use of `setlocale'.

Anyway, image cropping, and other internal passing of numeric data insede an application, should work independently of how numbers are to displayed according to a locale.

I don't know which file or script to look into, to suggest a patch. Any help appreciated.

Change History (2)

#1 @joemcgill
6 months ago

  • Keywords reporter-feedback added

Hi @knutsp,

I'm not able to reproduce this bug in WP 5.2-beta3. Can you confirm that this is still an issue, and if so, clarify the steps you used to reproduce this bug?

Thanks.

#2 @knutsp
6 months ago

  • Keywords dev-feedback added; reporter-feedback removed

The bug is still there in latest beta.

Install on PHP 7.3.3. Add ´setlocale´ to ´wp-config.php´ with a valid PHP locale string (important).

Using Firefox latest, upload an image to Media. Click "Edit Image" button. Drag the mouse pointer on the image to make a rectangle. Observe Selection field values being filled with Infinity.

Last edited 6 months ago by knutsp (previous) (diff)
Note: See TracTickets for help on using tickets.