Skip to content

Commit 9147883

Browse files
authored
Merge pull request #33 from ryanshoover/master
Better escaping to get rid of potential fatal error
2 parents fee3492 + 1c5938c commit 9147883

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

js/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ document.getElementById( 'wpbody' ).addEventListener( 'click', function ( event
88
var parent = event.path[ 1 ] || null;
99

1010
// If the parent div doesn't have our wpengine-geoip class, then abort
11-
if ( !parent || !parent.classList.includes( 'wpengine-geoip' ) ) {
11+
if ( !parent || -1 === jQuery.inArray( 'wpengine-geoip', parent.classList ) ) {
1212
return;
1313
}
1414

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: wpengine, markkelnar, stevenkword, stephenlin, ryanshoover, taylor
33
Tags: wpe, wpengine, geoip, localization, geolocation
44
Requires at least: 3.0.1
55
Tested up to: 4.8
6-
Stable tag: 1.2.1
6+
Stable tag: 1.2.2
77

88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -232,6 +232,10 @@ Please contact the WP Engine [Support Team](https://my.wpengine.com/support#gene
232232

233233
== Changelog ==
234234

235+
= 1.2.2 =
236+
- We're escaping our output. AND we're escaping our output in a way where the code will actually work!
237+
- We've also gotten rid of any bleeding-edge JavaScript. Sure, it's cool. But a plugin that works for everybody is even cooler.
238+
235239
= 1.2.1 =
236240
- When you dismiss the notice on development websites, it stays dismissed. Like it should.
237241
- The readme's code blocks actually have code in them now. Because what's the sense of a code block without code in it?

wpengine-geoip.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* Plugin Name: WP Engine GeoIP
4-
* Version: 1.2.1
4+
* Version: 1.2.2
55
* Description: Create a personalized user experienced based on location.
66
* Author: WP Engine
77
* Author URI: http://wpengine.com
@@ -633,7 +633,13 @@ public function action_admin_init_check_plugin_dependencies() {
633633
public function action_admin_notices() {
634634
foreach ( $this->admin_notices as $type => $notices ) {
635635
foreach ( $notices as $key => $notice ) {
636-
echo wp_kses( "<div class=\"notice notice-{$type} wpengine-geoip is-dismissible\" data-key=\"{$key}\"><p>$notice</p></div>" );
636+
?>
637+
<div class="notice notice-<?php echo esc_attr( $type ); ?> wpengine-geoip is-dismissible" data-key="<?php echo esc_attr( $key ); ?>">
638+
<p>
639+
<?php echo esc_html( $notice ); ?>
640+
</p>
641+
</div>
642+
<?php
637643
}
638644
}
639645
}

0 commit comments

Comments
 (0)