Opened 17 months ago
Closed 17 months ago
#19644 closed defect (bug) (fixed)
Unwanted backslash in output
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3.1 |
| Component: | UI | Version: | 3.3 |
| Severity: | minor | Keywords: | has-patch commit |
| Cc: |
Description
After upgrading to 3.3 I got the windows notificating me the new features.
the "Media uploader updated" notification says in italian translation:
Ora l\'icona unificata "media" lancia un uploader per tutti i tipi di file, e la nuova interfaccia "drag and drop" rende il caricamento un gioco da ragazzi.
You see there is a backslash which shouldn't be there. I think it's not a translation error, but a bug in the treating of those strings.
Attachments (1)
Change History (7)
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 3.3.1
The problem is in json_encode( esc_js( ) ):
$string = "Foo'bar \"Hello\""; var_dump( ( esc_js( $string ) ); // string(26) "Foo\'bar "Hello"" var_dump( json_encode( esc_js( $string ) ) ); // string(29) ""Foo\\'bar "Hello""" var_dump( json_encode( $string ); // string(19) ""Foo'bar \"Hello\""" var_dump( esc_js( json_encode( $string ) ) ); // string(38) ""Foo\'bar "Hello"""
- Keywords has-patch dev-feedback added; needs-patch removed
19644.patch does remove the esc_js calls.
- Keywords commit added; dev-feedback removed
Works for me, I think esc_js() was there from before we started to take the arguments and pass them to json_encode().

The translation is:
Ora l'icona unificata \"media\" lancia un uploader per tutti i tipi di file, e la nuova interfaccia \"drag and drop\" rende il caricamento un gioco da ragazzi.