WP-Insert Plugin Bug Fix

If you use WP-insert for wordpress to inject ads into your posts, and wanted to exclude certain pages from triggering this plugin, you’ll notice that “browse” button in section “Exclude Pages/Posts” icon doesn’t work.

I fixed this and commented on the blog of the plugin’s author where people complain about this but apparently, my comment got ignored so here it is:

Change line 237 from this

$allposts .= “<option value=’”.$page->ID.”‘>”. $page->post_title .”</option>”;

to

$allposts .= “<option value=’”.$page->ID.”‘>”.htmlspecialchars($page->post_title).”</option>”;

And line 243 from

$allposts .= “<option value=’”.$post->ID.”‘>”. $post->post_title.”</option>”;

to

$allposts .= “<option value=’”.$post->ID.”‘>”.htmlspecialchars($post->post_title).”</option>”;