Skip to content

Commit

Permalink
Merge pull request #153 from thrijith/issue/150
Browse files Browse the repository at this point in the history
Add escaping for block title
  • Loading branch information
schlessera authored Jun 4, 2018
2 parents 3c1d0e2 + 1e6def6 commit e0e6a83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ public function block( $args, $assoc_args ) {
);
$data = $this->extract_args( $assoc_args, $defaults );

$data['slug'] = $slug;
$data['title_ucfirst'] = ucfirst( $data['title'] );
$data['slug'] = $slug;
$data['title_ucfirst'] = ucfirst( $data['title'] );
$data['title_ucfirst_js'] = esc_js( $data['title_ucfirst'] );

$dashicon = $this->extract_dashicon( $assoc_args );
if ( $dashicon ) {
Expand Down
2 changes: 1 addition & 1 deletion templates/block-index-js.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This is the display title for your block, which can be translated with `i18n` functions.
* The block inserter will show this name.
*/
title: __( '{{title_ucfirst}}' ),
title: __( '{{title_ucfirst_js}}' ),
{{#dashicon}}
/**
Expand Down

0 comments on commit e0e6a83

Please sign in to comment.