Had a look at the D7 API and it may just be the case that only the call to drupal_http_request() needs a change.
This patch could work:
diff --git a/gtranslate_links.module b/gtranslate_links.module
index c37b9ea..f54a2a3 100644
--- a/gtranslate_links.module
+++ b/gtranslate_links.module
@@ -82,5 +82,5 @@ function gtranslate_is_translatable($url) {
// User is logged in. Let's see if GT can reach this page (2xx response)
// TODO: Using http requests doesn't seem right. We should be able to do this
// via drupal internals. http://drupal.org/node/470858
- return (substr(drupal_http_request($url, array('Gtranslate_links_loop' => '1', 'Connection' => 'Close'), 'HEAD')->code, 0, 1) == '2');
+ return (substr(drupal_http_request($url, array('headers' => array('Gtranslate_links_loop' => '1', 'Connection' => 'Close'), 'method' => 'HEAD'))->code, 0, 1) == '2');
}
I'm not planning a D7 version, but if the required changes are straightforward 'll be happy to merge any patches.
Comments
Comment #1
blinkingtwelve commentedHad a look at the D7 API and it may just be the case that only the call to
drupal_http_request()needs a change.This patch could work:
I'm not planning a D7 version, but if the required changes are straightforward 'll be happy to merge any patches.
Comment #2
mgiffordRunning it through Coder should help catch many issues.