1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Fixes Media-Manager remote image import.

This commit is contained in:
Cameron 2020-12-29 11:13:18 -08:00
parent b22697d1c0
commit e595c0841a
2 changed files with 3 additions and 1 deletions

View File

@ -2408,7 +2408,7 @@ class media_admin_ui extends e_admin_ui
$fileName = empty($uploadCaption) ? str_replace(array(".php",".html",".asp",".htm"),'',$fileName)."_".time() : eHelper::dasherize(strtolower($uploadCaption));
}
if(!$fl->getRemoteFile($tp->filter($_POST['upload_url'], 'file'), $fileName, 'import'))
if(!$fl->getRemoteFile($tp->filter($_POST['upload_url'], 'url'), $fileName, 'import'))
{
$mes->addError(IMALAN_176);
}

View File

@ -1270,6 +1270,7 @@ while($row = $sql->fetch())
*/
public function testFilter()
{
$url = 'http://www.domain.com/folder/folder2//1234_1_0.jpg';
$tests = array(
0 => array('input' => 'test123 xxx', 'mode' => 'w', 'expected' => 'test123xxx'),
@ -1278,6 +1279,7 @@ while($row = $sql->fetch())
3 => array('input' => 'test123 xxx', 'mode' => 'wds', 'expected' => 'test123 xxx'),
4 => array('input' => 'test123 xxx.jpg', 'mode' => 'file', 'expected' => 'test123-xxx.jpg'),
5 => array('input' => '2.1.4 (test)', 'mode' => 'version', 'expected' => '2.1.4'),
6 => array('input' => $url, 'mode'=>'url', 'expected' => $url),
);
foreach($tests as $var)