From 2a21668b432effe1d1549d42e64522aa957488ee Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 21 Jan 2012 18:24:21 +0100 Subject: [PATCH 1/2] Fix: add https and ssh --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index edee1e5cba3..7bcd1016ce6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -329,7 +329,7 @@ function dol_is_file($pathoffile) */ function dol_is_url($url) { - $tmpprot=array('file','http','ftp','zlib','data','ssh2','ogg','expect'); + $tmpprot=array('file','http','https','ftp','zlib','data','ssh','ssh2','ogg','expect'); foreach($tmpprot as $prot) { if (preg_match('/^'.$prot.':/i',$url)) return true; From a51948c24514918c330992880dfe29ef51560857 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 21 Jan 2012 18:46:36 +0100 Subject: [PATCH 2/2] Fix: wrong name --- test/phpunit/FilesLibTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 13c55453480..5a896452c3a 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -169,7 +170,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase $this->assertTrue($result); $url='file://www.dolibarr.org/download/file.zip'; - $result=dol_is_url($file); + $result=dol_is_url($url); print __METHOD__." result=".$result."\n"; $this->assertTrue($result);