PontusHorn / Pico-Search

Simple search feature for pages in your Pico CMS
MIT License
22 stars 4 forks source link

fix: server throws "undefined variable" errors for $folder and $searchTerm #8

Closed cfreitag closed 4 years ago

cfreitag commented 4 years ago

In line 67, it is possible that $folder is undefinded if the variable search_area isn't set and the if clause in line 62 is never entered. To prevent this, define $folder = array(); before it is first used, e. g. after line 57.

In line 171 the variable passed to public function isLowValueWord should be $searchTerm, not $word for the function to work.

See revised version of plugin attached.

40-PicoSearch-revised.php.txt

PontusHorn commented 4 years ago

Thanks for the heads-up. Fixed in 4476f858865306377e13cf820f0b89eabcbc6fc8 and b539f8e3596e6048aac9fee534565b91a2f505c3.