Skip to content

Commit e194a4d

Browse files
committed
Merge remote-tracking branch 'upstream' into trunk
2 parents e2097ca + a44019b commit e194a4d

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

src/wp-admin/contribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$title = __( 'Get Involved' );
1414

1515
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
16-
$header_alt_text = sprintf(
16+
$header_alt_text = sprintf(
1717
/* translators: %s: Version number. */
1818
__( 'WordPress %s' ),
1919
$display_version

src/wp-admin/credits.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$title = __( 'Credits' );
1515

1616
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
17-
$header_alt_text = sprintf(
17+
$header_alt_text = sprintf(
1818
/* translators: %s: Version number. */
1919
__( 'WordPress %s' ),
2020
$display_version

src/wp-admin/freedoms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$title = __( 'Freedoms' );
2020

2121
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
22-
$header_alt_text = sprintf(
22+
$header_alt_text = sprintf(
2323
/* translators: %s: Version number. */
2424
__( 'WordPress %s' ),
2525
$display_version

src/wp-admin/privacy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$title = __( 'Privacy' );
1414

1515
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
16-
$header_alt_text = sprintf(
16+
$header_alt_text = sprintf(
1717
/* translators: %s: Version number. */
1818
__( 'WordPress %s' ),
1919
$display_version

tests/phpunit/tests/db.php

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,28 +122,41 @@ public function test_locale_floats() {
122122

123123
/**
124124
* @ticket 10041
125+
*
126+
* @dataProvider data_esc_like
127+
*
128+
* @param string $input The input string.
129+
* @param string $expected The expected escaped string.
125130
*/
126-
public function test_esc_like() {
131+
public function test_esc_like( $input, $expected ) {
127132
global $wpdb;
128133

129-
$inputs = array(
130-
'howdy%', // Single percent.
131-
'howdy_', // Single underscore.
132-
'howdy\\', // Single slash.
133-
'howdy\\howdy%howdy_', // The works.
134-
'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?', // Plain text.
135-
);
136-
$expected = array(
137-
'howdy\\%',
138-
'howdy\\_',
139-
'howdy\\\\',
140-
'howdy\\\\howdy\\%howdy\\_',
141-
'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?',
142-
);
134+
$this->assertSame( $expected, $wpdb->esc_like( $input ) );
135+
}
143136

144-
foreach ( $inputs as $key => $input ) {
145-
$this->assertSame( $expected[ $key ], $wpdb->esc_like( $input ) );
146-
}
137+
public function data_esc_like() {
138+
return array(
139+
'single percent' => array(
140+
'howdy%',
141+
'howdy\\%',
142+
),
143+
'single underscore' => array(
144+
'howdy_',
145+
'howdy\\_',
146+
),
147+
'single slash' => array(
148+
'howdy\\',
149+
'howdy\\\\',
150+
),
151+
'the works' => array(
152+
'howdy\\howdy%howdy_',
153+
'howdy\\\\howdy\\%howdy\\_',
154+
),
155+
'plain text' => array(
156+
'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?',
157+
'howdy\'"[[]*#[^howdy]!+)(*&$#@!~|}{=--`/.,<>?',
158+
),
159+
);
147160
}
148161

149162
/**

0 commit comments

Comments
 (0)