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; 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);