--- id: 11 title: 'Fix Brave request building: lazy URL + single encode' status: done priority: high created: 2026-07-17T03:57:00.444816503+02:00 updated: 2026-07-20T14:15:59.825243496+02:00 started: 2026-07-20T14:15:59.830054903+02:00 completed: 2026-07-20T14:15:59.830054903+02:00 tags: - search - bug class: standard --- From framework review (docs/framework_review.md). Two-part fix in resource/Brave.class.php + lib/ImgSearch.class.php: 1. Move URL construction from setQuery() to getData() so setParam('start'/'size') values are applied (currently size defaults to 3 instead of 16, offset is never sent). 2. Remove double urlencode: ImgSearch passes urlencode(word) into Brave::setQuery which urlencodes again → %2520 for spaces. Fix: pass raw word from ImgSearch; engine owns encoding. [[2026-07-17]] Fri 12:26 P0-1: Moved URL construction from setQuery() to new buildRequest() called from getData() — size/offset now use setParam() values (resource/Brave.class.php). P0-2: Removed urlencode() call from ImgSearch::getImageData() — raw word passed to engine, single encode in Brave (lib/ImgSearch.class.php). Both pass php -l. [[2026-07-17]] Fri 12:26 P0-1 + P0-2 implemented. Changes to resource/Brave.class.php and lib/ImgSearch.class.php. Both pass php -l. Ready for your commit.