original_string: public function is_valid_image() {
          $mimetype = $this->get_mimetype();
          if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
              return false;
          }
          if (!$info = $this->get_imageinfo()) {
              return false;
          }
          if ($info['mimetype'] !== $mimetype) {
              return false;
          }
          // ok, GD likes this image
          return true;
      }
code: public function is_valid_image() {
          $mimetype = $this->get_mimetype();
          if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
              return false;
          }
          if (!$info = $this->get_imageinfo()) {
              return false;
          }
          if ($info['mimetype'] !== $mimetype) {
              return false;
          }
          // ok, GD likes this image
          return true;
      }
code_tokens: public function is_valid_image ( ) { $ mimetype = $ this -> get_mimetype ( ) ; if ( ! file_mimetype_in_typegroup ( $ mimetype , 'web_image' ) ) { return false ; } if ( ! $ info = $ this -> get_imageinfo ( ) ) { return false ; } if ( $ info [ 'mimetype' ] !== $ mimetype ) { return false ; } // ok, GD likes this image return true ; }
docstring: Verifies the file is a valid web image - gif, png and jpeg only.
  
  It should be ok to serve this image from server without any other security workarounds.
  
  @return bool true if file ok
docstring_tokens: Verifies the file is a valid web image - gif png and jpeg only .