BookStackApp/BookStack

View on GitHub
app/Search/Options/ExactSearchOption.php

Summary

Maintainability
A
0 mins
Test Coverage
<?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 . '"';
    }
}