BookStackApp_BookStack/app/Search/Options/ExactSearchOption.php
Dan Brown 93c677a6a9
Searching: Added negation support to UI and term handling
Updated/added tests to cover.
Support for actual search queries still remains.
2024-10-03 15:59:50 +01:00

14 lines
324 B
PHP

<?php
namespace BookStack\Search\Options;
class ExactSearchOption extends SearchOption
{
public function toString(): string
{
$escaped = str_replace('\\', '\\\\', $this->value);
$escaped = str_replace('"', '\"', $escaped);
return ($this->negated ? '-' : '') . '"' . $escaped . '"';
}
}