|
@@ -296,7 +296,7 @@ switch($_['action']){
|
|
|
$part->save();
|
|
|
|
|
|
if(isset($_['picture'])){
|
|
|
- $stream = base64_decode(preg_replace('|data:image/[^;]*;base64,|i','',$_['picture']));
|
|
|
+ $stream = base64_decode(preg_replace('|.*image/[^;]*;base64,|i','',$_['picture']));
|
|
|
$dir = File::dir().'hackpoint'.SLASH.'part'.SLASH.$part->id;
|
|
|
if(!file_exists($dir)) mkdir($dir,0755,true);
|
|
|
file_put_contents($dir.SLASH.'cover.jpg', $stream);
|