ZapMachine/kanban/tasks/011-fix-brave-request-building-lazy-url-single-encode.md

22 lines
1.2 KiB
Markdown
Raw Normal View History

2026-07-19 22:49:00 +02:00
---
id: 11
title: 'Fix Brave request building: lazy URL + single encode'
status: review
priority: high
created: 2026-07-17T03:57:00.444816503+02:00
updated: 2026-07-17T12:26:38.759875442+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.