Skip to content

Commit

Permalink
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/comm/propal/list.php
  • Loading branch information
eldy committed Jul 27, 2018
2 parents 7821e21 + 894f484 commit 7af42c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions htdocs/comm/propal/list.php
Expand Up @@ -310,7 +310,7 @@
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
if ($search_availability) $sql .= " AND p.fk_availability IN (".$db->escape($search_availability).')';

if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
Expand Down Expand Up @@ -432,7 +432,7 @@
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer);
if ($search_refprojet) $param.='&search_refprojet='.urlencode($search_refprojet);
if ($search_refproject) $param.='&search_refproject='.urlencode($search_refproject);
if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/lib/files.lib.php
Expand Up @@ -1133,10 +1133,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
* @param int $nophperrors Disable all PHP output errors
* @param int $nohook Disable all hooks
* @param object $object Current object in use
* @param boolean $allowdotdot Allow to delete file path with .. inside. Never use this, it is reserved for migration purpose.
* @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error
* @see dol_delete_dir
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null,$allowdotdot=false)
{
global $db, $conf, $user, $langs;
global $hookmanager;
Expand All @@ -1148,7 +1149,7 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n

// Security:
// We refuse transversal using .. and pipes into filenames.
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
if ((! $allowdotdot && preg_match('/\.\./',$file)) || preg_match('/[<>|]/',$file))
{
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
return false;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/upgrade2.php
Expand Up @@ -4472,7 +4472,7 @@ function migrate_delete_old_files($db,$langs,$conf)
$result=1;
if (file_exists($filetodelete))
{
$result=dol_delete_file($filetodelete);
$result=dol_delete_file($filetodelete,0,0,0,null,true);
if (! $result)
{
$langs->load("errors");
Expand Down

0 comments on commit 7af42c6

Please sign in to comment.