Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -82,7 +82,6 @@ class _Url extends Text
|
||||
$contentType = ( isset( $response->httpHeaders['Content-Type'] ) ) ? $response->httpHeaders['Content-Type'] : ( ( isset( $response->httpHeaders['content-type'] ) ) ? $response->httpHeaders['content-type'] : NULL );
|
||||
if( $contentType )
|
||||
{
|
||||
|
||||
foreach ( is_array( $this->options['allowedMimes'] ) ? $this->options['allowedMimes'] : array( $this->options['allowedMimes'] ) as $mime )
|
||||
{
|
||||
if ( preg_match( '/^' . str_replace( '~~', '.+', preg_quote( str_replace( '*', '~~', $mime ), '/' ) ) . '$/i', $contentType ) )
|
||||
@@ -116,7 +115,14 @@ class _Url extends Text
|
||||
}
|
||||
}
|
||||
|
||||
$this->value = \IPS\File::create( $this->options['file'], $filename, $response );
|
||||
try
|
||||
{
|
||||
$this->value = \IPS\File::create( $this->options['file'], $filename, $response );
|
||||
}
|
||||
catch( \InvalidArgumentException $e )
|
||||
{
|
||||
throw new \DomainException( 'form_url_error' );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \IPS\Http\Request\Exception $e )
|
||||
|
||||
Reference in new issue
Block a user