Pictures with '&' in name can't generate thumbnails #1405

Open
opened 2026-10-05 00:42:38 +02:00 by adam · 0 comments
Owner

If pictures have names with character '&', e.g: 'xxx&xxx.jpg', we can't get thumbnails for them.

The problem is in 'i.php', row 167:

if ($pos=strpos($req, '&'))
{
  $req = substr($req, 0, $pos);
}

This code will cut the picture's link before '&', and cause error: 'Missing -';

suggest solution:
change the code to:

if ($pos=strrpos($req, '&b='))
{
  $req = substr($req, 0, $pos);
}
if ($pos=strrpos($req, '&ajaxload='))
{
  $req = substr($req, 0, $pos);
}
If pictures have names with character '&', e.g: 'xxx&xxx.jpg', we can't get thumbnails for them. The problem is in 'i.php', row 167: > if ($pos=strpos($req, '&')) > { > $req = substr($req, 0, $pos); > } This code will cut the picture's link before '&', and cause error: 'Missing -'; **suggest solution:** change the code to: > if ($pos=strrpos($req, '&b=')) > { > $req = substr($req, 0, $pos); > } > if ($pos=strrpos($req, '&ajaxload=')) > { > $req = substr($req, 0, $pos); > } <!-- github-sync-id:1118040348 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1405