カテゴリ | |
---|---|
サマリ | コメントアウトした部分が単語検索でひっかかる。 |
バージョン | 1.4.3 |
投稿者 | フラゥ |
状態 | 完了 |
投稿日 | 2004-08-20 (FRI) 22:49:38 |
データ登録用のテンプレートの中に、説明文や記入例をコメントアウトして入れてあります。 コメントアウトされている分の単語が、単語検索をかけたときに引っかかるため、特定の単語を検索した場合、データすべてが単語検索の結果で出てきてしまいます。 コメントアウトされている行を単語検索対象からはずすことはできないのでしょうか?
$source = preg_replace('/^\/\/.*/', '', $source);
L.254あたり // Search for page contents foreach ($keys as $key) { --- $b_match = preg_match($key, get_source($page, TRUE, TRUE)); +++ $source = preg_replace('#^\/\/.*#', '', get_source($page, TRUE, TRUE)); +++ $source = preg_replace('#\n\/\/.*#', '', $source); +++ $b_match = preg_match($key, $source); if ($b_type xor $b_match) break; // OR }
L.254あたり // Search for page contents foreach ($keys as $key) { --- $b_match = preg_match($key, get_source($page, TRUE, TRUE)); +++ $source = preg_replace('#^\/\/.*#m', '', get_source($page, TRUE, TRUE)); +++ $b_match = preg_match($key, $source); if ($b_type xor $b_match) break; // OR }