|
@@ 1369-1373 (lines=5) @@
|
| 1366 |
|
protected function parse_data_scheme( $str, $extTable ) { |
| 1367 |
|
$data = $name = ''; |
| 1368 |
|
if ($fp = fopen('data://'.substr($str, 5), 'rb')) { |
| 1369 |
|
if ($data = stream_get_contents($fp)) { |
| 1370 |
|
$meta = stream_get_meta_data($fp); |
| 1371 |
|
$ext = isset($extTable[$meta['mediatype']])? '.' . $extTable[$meta['mediatype']] : ''; |
| 1372 |
|
$name = substr(md5($data), 0, 8) . $ext; |
| 1373 |
|
} |
| 1374 |
|
fclose($fp); |
| 1375 |
|
} |
| 1376 |
|
return array($data, $name); |
|
@@ 1843-1848 (lines=6) @@
|
| 1840 |
|
$this->uploadDebug = 'Upload error: unable open tmp file'; |
| 1841 |
|
} |
| 1842 |
|
return $result; |
| 1843 |
|
} else { |
| 1844 |
|
// for form clipboard with Google Chrome |
| 1845 |
|
$type = $files['type'][$i]; |
| 1846 |
|
$ext = isset($extTable[$type])? '.' . $extTable[$type] : ''; |
| 1847 |
|
$name = substr(md5(basename($tmpname)), 0, 8) . $ext; |
| 1848 |
|
} |
| 1849 |
|
} |
| 1850 |
|
|
| 1851 |
|
// do hook function 'upload.presave' |