stop using ? as a wildcard
This commit is contained in:
parent
c2231432f3
commit
0ec305a886
2 changed files with 5 additions and 10 deletions
|
@ -110,7 +110,6 @@ class Tag
|
|||
natcasesort($tags1);
|
||||
natcasesort($tags2);
|
||||
|
||||
|
||||
for ($i = 0; $i < count($tags1); $i++) {
|
||||
if ($tags1[$i]!==$tags2[$i]) {
|
||||
var_dump($tags1);
|
||||
|
@ -163,7 +162,7 @@ class Tag
|
|||
$term = str_replace('_', '\_', $term);
|
||||
$term = str_replace('%', '\%', $term);
|
||||
$term = str_replace('*', '%', $term);
|
||||
$term = str_replace("?", "_", $term);
|
||||
// $term = str_replace("?", "_", $term);
|
||||
return $term;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,18 +46,14 @@ class IndexTest extends ShimmiePHPUnitTestCase
|
|||
{
|
||||
$this->log_in_as_user();
|
||||
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "question? colon:thing exclamation!");
|
||||
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "question. colon_thing exclamation%");
|
||||
|
||||
$this->assert_search_results(["question?"], [$image_id_1]);
|
||||
$page = $this->get_page('post/list/question?/1');
|
||||
$this->assertEquals("/post/view/$image_id_1", $page->redirect);
|
||||
|
||||
$this->assert_search_results(["question."], [$image_id_2]);
|
||||
$this->assert_search_results(["colon:thing"], [$image_id_1]);
|
||||
$page = $this->get_page('post/list/colon:thing/1');
|
||||
$this->assertEquals("/post/view/$image_id_1", $page->redirect);
|
||||
|
||||
$this->assert_search_results(["colon_thing"], [$image_id_2]);
|
||||
$this->assert_search_results(["exclamation!"], [$image_id_1]);
|
||||
$page = $this->get_page('post/list/exclamation!/1');
|
||||
$this->assertEquals("/post/view/$image_id_1", $page->redirect);
|
||||
$this->assert_search_results(["exclamation%"], [$image_id_2]);
|
||||
}
|
||||
|
||||
// base case
|
||||
|
|
Reference in a new issue