Created
December 8, 2014 02:29
-
-
Save pwenzel/deecd99ad1c485b33ec6 to your computer and use it in GitHub Desktop.
Fix Unescaped Title Attributes in plugin Custom Post Types Relationships (CPTR)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/wp-content/plugins/custom-post-types-relationships-cptr/cptr.php b/wp-content/plugins/custom-post-types-relationships-cptr/cptr.php | |
index 2d82e17..853a51d 100644 | |
--- a/wp-content/plugins/custom-post-types-relationships-cptr/cptr.php | |
+++ b/wp-content/plugins/custom-post-types-relationships-cptr/cptr.php | |
@@ -136,7 +136,7 @@ function cptr_category_selector() { | |
if (!empty($relations)) : | |
foreach($relations as $relation) : | |
$post = get_post($relation); | |
- echo "<div title='" . $post->post_title . "' class='thepost' id='post-".$post->ID ."'> | |
+ echo "<div title='" . esc_attr($post->post_title) . "' class='thepost' id='post-".$post->ID ."'> | |
<a href='#' class='removeme'>Remove</a> | |
<p><strong>" . $post->post_title . "</strong></p> | |
<input type='hidden' name='reladded[]' value='" . $post->ID . "' /> | |
@@ -174,7 +174,7 @@ function cptr_cats() { | |
if (!empty($posts)) { | |
foreach ( $posts as $post ) { | |
setup_postdata($post); | |
- echo "<div title='" . $post->post_title . "' class='thepost' id='post-".$post->ID ."'> | |
+ echo "<div title='" . esc_attr($post->post_title) . "' class='thepost' id='post-".$post->ID ."'> | |
<a href='#' class='addme'>Add</a> | |
<p><strong>" . $post->post_title . "</strong></p> | |
<input type='hidden' name='related[]' value='" . $post->ID . "' /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment