Skip to content

Commit

Permalink
v0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdual committed Feb 24, 2019
1 parent 61fc165 commit 23eb964
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public static function multiple_file_array($file_array)
* @param array $mime_map (optional)
* @return array
*/
public static function from_base64($base64, $mime_map = null)
public static function from_base64($base64, $mime_map = [])
{
$encoded = explode(";base64,", $base64, 2);
if (isset($encoded[1])) {
Expand All @@ -526,7 +526,7 @@ public static function from_base64($base64, $mime_map = null)
* @return array
* @param array $mime_map (optional)
*/
public static function from_raw_input($mime_map = null)
public static function from_raw_input($mime_map = [])
{
return self::create_temp_file(file_get_contents("php://input"), $mime_map);
}
Expand All @@ -537,17 +537,17 @@ public static function from_raw_input($mime_map = null)
* @param array $mime_map (optional)
* @return array
*/
public static function create_temp_file($source, $mime_map = null)
public static function create_temp_file($source, $mime_map = [])
{
$temp = tmpfile();
fwrite($temp, $source);
$meta = stream_get_meta_data($temp);
$mime = mime_content_type($meta["uri"]);
$split = explode("/", $mime);

if ($mime_map && isset($mime_map[$mime])) {
if (isset($mime_map[$mime])) {
$ext = $mime_map[$mime];
} else {
$split = explode("/", $mime);
$ext = array_pop($split);
}

Expand Down

0 comments on commit 23eb964

Please sign in to comment.