ensure short tags aren't part of search results

This commit is contained in:
John Bintz 2009-09-23 21:47:22 -04:00
parent 2eac8f71dc
commit 0723e03ce9
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ class WDTSTranscriptManager {
function _update_search_field($transcripts) {
if (!empty($this->search_key)) {
$search_lines = array();
foreach ($transcripts as $transcript) { $search_lines[] = $transcript['transcript']; }
foreach ($transcripts as $transcript) { $search_lines[] = preg_replace('#\[[^\]]+\]#', '', $transcript['transcript']); }
update_post_meta($this->post_id, $this->search_key, implode(" ", $search_lines));
}
}

View File

@ -60,7 +60,7 @@ class WDTSTranscriptTest extends PHPUnit_Framework_TestCase {
$this->w->save_transcript(array(
'language' => 'fr',
'transcript' => "il s'agit d'une nouvelle transcription"
'transcript' => "[dialog]il s'agit d'une nouvelle transcription[/dialog]"
));
$this->assertEquals(
@ -73,7 +73,7 @@ class WDTSTranscriptTest extends PHPUnit_Framework_TestCase {
),
array(
'language' => 'fr',
'transcript' => "il s'agit d'une nouvelle transcription",
'transcript' => "[dialog]il s'agit d'une nouvelle transcription[/dialog]",
'user_id' => 1,
'key' => 1
),
@ -100,7 +100,7 @@ class WDTSTranscriptTest extends PHPUnit_Framework_TestCase {
),
array(
'language' => 'fr',
'transcript' => "il s'agit d'une nouvelle transcription",
'transcript' => "[dialog]il s'agit d'une nouvelle transcription[/dialog]",
'user_id' => 1,
'key' => 1
),