Php “'正在转换为”&8216;”

Php “'正在转换为”&8216;”,php,wordpress,Php,Wordpress,我这里有一个用于wordpress的自定义插件,它可以将帖子评论中的所有hashtaged术语转换为可搜索的链接 我知道这个插件导致了这个问题,因为它只是在停用后才被关闭,我只是看不出在这个代码中我需要在哪里编辑一些内容或添加一些内容来防止它 如果您的眼睛更有经验,我们将不胜感激。获取博客信息的功能是什么url'-返回设置>常规中设置的站点地址url。此数据从wp_选项表中的主记录中检索。相当于主url。 add_filter( 'comment_text', 'mh_commentta

我这里有一个用于wordpress的自定义插件,它可以将帖子评论中的所有hashtaged术语转换为可搜索的链接

我知道这个插件导致了这个问题,因为它只是在停用后才被关闭,我只是看不出在这个代码中我需要在哪里编辑一些内容或添加一些内容来防止它


如果您的眼睛更有经验,我们将不胜感激。

获取博客信息的功能是什么url'-返回设置>常规中设置的站点地址url。此数据从wp_选项表中的主记录中检索。相当于主url。
    add_filter( 'comment_text', 'mh_commenttaglink' , 50 );

    function mh_commenttaglink( $text ) {

    // RegEx to find #tag, #hyphen-tag with letters and numbers
    $mh_regex = "/\#[a-zA-Z0-9-]+/";

    // Use that RegEx and populate the hits into an array
    preg_match_all( $mh_regex , $text , $mh_matches );

    // If there's any hits then loop though those and replace those hits with a link
    for ( $mh_count = 0; $mh_count < count( $mh_matches[0] ); $mh_count++ )
            {
                    $mh_old = $mh_matches[0][$mh_count];
                    $mh_old_lesshash = str_replace( '#' , ' ' , $mh_old );
                    $mh_new = str_replace( $mh_old , '<a href="' . get_bloginfo( url ) . '/?s=%23' . $mh_old_lesshash . '"/ rel="tag">' . $mh_old . '</a>' , $mh_matches[0][$mh_count] );
                    $text = str_replace( $mh_old  , $mh_new , $text );
            }
    // Return any substitutions
    return $text;
    }