According to the Drupal system requirements for PHP it is preferable to disable allow_url_fopen in the PHP configuration. This leads to the following error and broken images from the staticmap module.

Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0

The solution is to use drupal_http_request() instead of file_get_contents() as per the attached patch.

CommentFileSizeAuthor
staticmap-use-drupal-http-request.patch454 bytesmstrelan

Comments

rudiedirkx’s picture

rudiedirkx’s picture

Status: Needs review » Needs work

You should at least check if drupal_http_request() returns something useful. It might not even contain ->data. The calling function should also check if it worked, and if it didn't, not use the cached file.