Follows-up c94dea7029.
* Avoid strlen() where a strict check suffices.
* Use substr() for both comparison and stripping, avoid
potentially expensive, but also fragile, because strlen()-1
can produce $str[-1], which would
> PHP Notice: Uninitialized string offset: -1
Luckily, the implied null would work as expected, given that
`null !== "\n"` and produces the same result.
Change-Id: If61e5e412aaa2dc7c00c4441b3b7bd5f04160ec8
The controller should pass through lines of input exactly as
they were provided, only stripping the trailing newline that
delimits items. The trim was making `door` and `door ` equivilant
but for the use case in search the distinction is important.
Additionally check that the line is actually empty, don't throw
away inputs like '0' which are falsy.
Change-Id: Ifac910543fdb46a27da021e831e3e18befefcfc5