@@ 1413-1417 (lines=5) @@ | ||
1410 | protected function parse_data_scheme( $str, $extTable ) { |
|
1411 | $data = $name = ''; |
|
1412 | if ($fp = fopen('data://'.substr($str, 5), 'rb')) { |
|
1413 | if ($data = stream_get_contents($fp)) { |
|
1414 | $meta = stream_get_meta_data($fp); |
|
1415 | $ext = isset($extTable[$meta['mediatype']])? '.' . $extTable[$meta['mediatype']] : ''; |
|
1416 | $name = substr(md5($data), 0, 8) . $ext; |
|
1417 | } |
|
1418 | fclose($fp); |
|
1419 | } |
|
1420 | return array($data, $name); |
|
@@ 1885-1890 (lines=6) @@ | ||
1882 | $this->uploadDebug = 'Upload error: unable open tmp file'; |
|
1883 | } |
|
1884 | return $result; |
|
1885 | } else { |
|
1886 | // for form clipboard with Google Chrome |
|
1887 | $type = $files['type'][$i]; |
|
1888 | $ext = isset($extTable[$type])? '.' . $extTable[$type] : ''; |
|
1889 | $name = substr(md5(basename($tmpname)), 0, 8) . $ext; |
|
1890 | } |
|
1891 | } |
|
1892 | ||
1893 | // do hook function 'upload.presave' |