Skip to content

Commit d0c946a

Browse files
committed
Escape JS object
1 parent 09bad0f commit d0c946a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inc/class-shapely-builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public function get_all_pages() {
4343
if ( $the_pages->have_posts() ) {
4444
foreach ( $the_pages->posts as $post ) {
4545
$this->pages[ $post->post_name ] = array(
46-
'id' => $post->ID,
47-
'title' => $post->post_title,
46+
'id' => absint( $post->ID ),
47+
'title' => esc_html( $post->post_title ),
4848
);
49-
$this->sidebars[] = 'shapely-' . $post->post_name;
49+
$this->sidebars[] = 'shapely-' . $post->post_name;
5050
}
5151
}
5252

@@ -79,7 +79,7 @@ public function register_sidebars() {
7979

8080
public function enqueue_builder_js() {
8181
$builder_settings = array(
82-
'siteURL' => site_url(),
82+
'siteURL' => esc_url( site_url() ),
8383
'pages' => $this->pages,
8484
);
8585
wp_enqueue_script( 'shapely_builder_customizer', get_template_directory_uri() . '/assets/js/customizer-builder.js', array(), '20140317', true );

0 commit comments

Comments
 (0)