2
0
forked from Wavyzz/dolibarr

Update html.formfile.class.php

Corrects a bug that adds a second '?' in the url string. When strpos returns 0 as the initial position for '?', it is (mis)taken as FALSE value, and then replaced by a second '?' in the list of get parameters, resulting in something like:
/compta/facture/card.php?facid=397?action=remove_file...
instead of 
/compta/facture/card.php?facid=397&action=remove_file...
This commit is contained in:
pnueda
2020-02-07 18:01:14 +01:00
committed by GitHub
parent 9f9002d6a6
commit 8eb9c10788

View File

@@ -859,7 +859,7 @@ class FormFile
if ($delallowed)
{
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
$out .= '<a href="'.$tmpurlsource.(strpos($tmpurlsource, '?') ? '&amp;' : '?').'action=remove_file&amp;file='.urlencode($relativepath);
$out .= '<a href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&amp;').'action=remove_file&amp;file='.urlencode($relativepath);
$out .= ($param ? '&amp;'.$param : '');
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?