Permalink
Browse files

Avoid Conflicts with Keywords

A dash, -, get's counted as a wordbreak. So some of the words inside of
the comments were getting replaced. This fixes it.

http://wordpress.org/support/topic/plugin-seo-auto-linker-content-posts-not-displayed
  • Loading branch information...
1 parent b415aae commit 12181c44a09497f76ab8acafc397baa8529d14b2 @chrisguitarguy chrisguitarguy committed Aug 30, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 inc/front.php
View
@@ -30,6 +30,7 @@ class SEO_Auto_Linker_Front extends SEO_Auto_Linker_Base
*/
public static function init()
{
+ self::$hash = md5(apply_filters('seoal_prefix_hash', 'seo-auto-linker'));
add_filter(
'the_content',
array(get_class(), 'content'),
@@ -280,14 +281,18 @@ protected static function get_meta($post, $key)
* Loop through a an array of matches and create an associative array of
* key value pairs to use for str replacements
*
+ * @todo Look into just hashing the entire array key with md5 or
+ * something. Might help avoid conflicts?
+ *
* @since 0.7
*/
protected function gen_replacements($arr, $key, $start=0)
{
$rv = array();
+ $h = self::$hash;
foreach($arr as $a)
{
- $rv["<!--seo-auto-linker-{$key}-{$start}-->"] = $a;
+ $rv["<!--{$h}-{$key}-{$start}-->"] = $a;
$start++;
}
return $rv;

0 comments on commit 12181c4

Please sign in to comment.