Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#19644 closed defect (bug) (fixed)

Unwanted backslash in output

Reported by: donpaolo's profile donpaolo Owned by: ryan's profile ryan
Milestone: 3.3.1 Priority: normal
Severity: minor Version: 3.3
Component: UI Keywords: has-patch commit
Focuses: 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)

19644.patch (2.5 KB) - added by ocean90 13 years ago.

Download all attachments as: .zip

Change History (7)

#1 @ocean90
13 years ago

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.

#2 @ocean90
13 years ago

  • 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"""

@ocean90
13 years ago

#3 @ocean90
13 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed

19644.patch does remove the esc_js calls.

#4 @nacin
13 years ago

  • 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().

#5 @nacin
13 years ago

In [19655]:

Remove esc_js() as this content now gets json encoded rather than a straight echo. props ocean90. see #19644, for trunk.

#6 @ryan
13 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [19659]:

Remove esc_js() as this content now gets json encoded rather than a straight echo. props ocean90. fixes #19644, for 3.3

Note: See TracTickets for help on using tickets.