- foreach ( Photo::supportedTypes() as $m=>$e){
- $photo = str_replace(".$e",'',$photo);
+ $photo = str_replace(['.jpg', '.png', '.gif'], ['', '', ''], $photo);
+
+ foreach (Image::supportedTypes() AS $m => $e) {
+ $photo = str_replace('.' . $e, '', $photo);