Skip to content

Commit e6b4919

Browse files
committed
Fix CS
1 parent 933c4d2 commit e6b4919

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

class-wp-bootstrap-navwalker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ public static function fallback( $args ) {
376376

377377
// if $args has 'echo' key and it's true echo, otherwise return.
378378
if ( array_key_exists( 'echo', $args ) && $args['echo'] ) {
379-
echo $fallback_output; // WPCS: XSS OK.
379+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
380+
echo $fallback_output;
380381
} else {
381382
return $fallback_output;
382383
}

tests/test-navwalker.php

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ public function setUp() {
3939
$this->valid_linkmod_typeflags = array(
4040
'dropdown-header',
4141
'dropdown-divider',
42-
'dropdown-item-text'
42+
'dropdown-item-text',
4343
);
4444

4545
// array of all possible linkmods, including the valid typeflags.
46-
$this->valid_linkmod_classes = array_merge( $this->valid_linkmod_typeflags, array(
47-
'disabled',
48-
'sr-only',
49-
) );
46+
$this->valid_linkmod_classes = array_merge(
47+
$this->valid_linkmod_typeflags,
48+
array(
49+
'disabled',
50+
'sr-only',
51+
)
52+
);
5053

5154
// array of valid font-awesome icon class starters plus some randomly
5255
// chosen icon classes and some variations of upper/lower case letters.
@@ -186,9 +189,14 @@ public function test_fallback_function_output_loggedout() {
186189
);
187190

188191
// set 'echo' to false and request the markup returned.
189-
$fallback_output_return = WP_Bootstrap_Navwalker::fallback( array_merge( $this->valid_sample_fallback_args, array(
190-
'echo' => false,
191-
) ) );
192+
$fallback_output_return = WP_Bootstrap_Navwalker::fallback(
193+
array_merge(
194+
$this->valid_sample_fallback_args,
195+
array(
196+
'echo' => false,
197+
)
198+
)
199+
);
192200

193201
// return and echo should result in the same values (both empty).
194202
$this->assertEquals(
@@ -227,9 +235,14 @@ public function test_fallback_function_output_loggedin() {
227235
);
228236

229237
// set 'echo' to false and request the markup returned.
230-
$fallback_output_return = WP_Bootstrap_Navwalker::fallback( array_merge( $this->valid_sample_fallback_args, array(
231-
'echo' => false,
232-
) ) );
238+
$fallback_output_return = WP_Bootstrap_Navwalker::fallback(
239+
array_merge(
240+
$this->valid_sample_fallback_args,
241+
array(
242+
'echo' => false,
243+
)
244+
)
245+
);
233246

234247
// return and echo should both produce the same strings.
235248
$this->assertEquals(

0 commit comments

Comments
 (0)