PluginProbe
Assistant – Every Day Productivity Apps / 1.4.7
Assistant – Every Day Productivity Apps v1.4.7
1.5.5.1 1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 All 72 releases
← All changes | backend/src/Hooks/ImageProxy.php +0 -22 1.5.5.1 → 1.4.7 View file →
@@ -37,19 +37,8 @@
37 37
38 38 $body = wp_remote_retrieve_body( $response );
39 39 $headers = wp_remote_retrieve_headers( $response );
40 40
41 - // validate image
42 - $filesystem = self::filesystem();
43 - $tmpfile = tempnam( '/tmp', 'assistant' );
44 - $filesystem->put_contents( $tmpfile, $body );
45 - $validimage = wp_get_image_mime( $tmpfile );
46 - $filesystem->delete( $tmpfile );
47 -
48 - if ( ! $validimage ) {
49 - return false;
50 - }
51 -
52 41 if ( ! isset( $headers['content-type'] ) ) {
53 42 return;
54 43 } elseif ( 0 !== strpos( $headers['content-type'], 'image/' ) ) {
55 44 return;
@@ -57,17 +46,6 @@
57 46
58 47 header( 'Content-type: ' . $headers['content-type'] );
59 48 echo $body;
60 49 die();
61 - }
62 -
63 - private function filesystem() {
64 - global $wp_filesystem;
65 -
66 - if ( is_null( $wp_filesystem ) ) {
67 - require_once ABSPATH . '/wp-admin/includes/file.php';
68 - WP_Filesystem();
69 - }
70 -
71 - return $wp_filesystem;
72 50 }
73 51 }