私はWordPressの私のプラグインでエラーを持って、私はそこに到達したとき、それはPHP正規表現不明修飾子「C」
if (is_array($related)) {
foreach ($related as $value) {
$words[] = $this->search_string($value);
if (isset($this->settings[ 'tooltip' ])) {
$links[] = $this->tooltip_html($link, '$0', $post, $target, $nofollow, $internal);
} else {
$links[] = '<a href="' . $link . '"' . $target . $nofollow . '>$0</a>';
}
}
}
endwhile;
if (!empty($words)) {
if (isset($this->settings[ 'first_occurence' ])) {
$text = preg_replace($words, $links, $text, 1);
} else {
$text = preg_replace($words, $links, $text); //line 89
}
}
wp_reset_postdata();
}
であるライン89上でエラーを示したので、私はSEARCH_STRING()関数が呼び出されていることがわかりましたすぐにそこに行って、〜の修正を適用したシンボルの文字列を見つけましたが、これが動作するかどうかわかりません。
public function search_string($title) {
return '~/(?<!\w)((?i)~' . $title . '~(?-i))(?=[ \.\,\:\;\*\"\)\!\?\/\%\$\£\|\^\<\>])(?![^<]*(<\/a>|<\/span>|" \/>|>))/~';
} あなたは私がしたいすべての単一引用符は、私は正しい道にいる尋ねる前に、私は〜を適用している見ているよう?
$タイトル。 '〜 'とし、regxの変数入力に' preg_quote() 'を必ず使用してください。 – ArtisticPhoenix