Pico-Tags-Plugin icon indicating copy to clipboard operation
Pico-Tags-Plugin copied to clipboard

Improvement: Trim each tag to avoid unwanted spaces.

Open pfiaux opened this issue 11 years ago • 0 comments

I assumed that i could have spaces in my comma separated list of tags and the results were that from the second tag on i'd end up with urls like tag/ tag2.

replacing (line 35ish)

if (strlen($headers['tags']) > 1) $headers['tags'] = explode(',', $headers['tags']);
else $headers['tags'] = NULL;

with

if (strlen($headers['tags']) > 1) {
  $headers['tags'] = explode(',', $headers['tags']);
  foreach($headers['tags'] as &$tag) {
    $tag = trim($tag);
  }
}
else
{
  $headers['tags'] = NULL;
}

did the trick for me. Thought I'd bring it up. This should still allow for spaces in tags made of multiple words. (perhaps these should be replaced with _ for the urls)

pfiaux avatar Jan 05 '14 18:01 pfiaux