diff --git a/includes/locale.inc b/includes/locale.inc index c168da0..c52ea59 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1485,7 +1485,17 @@ function _locale_parse_js_file($filepath) { $parsed_url = drupal_parse_url($filepath); $filepath = $parsed_url['path']; // Load the JavaScript file. - $file = file_get_contents($filepath); + if (file_uri_scheme($filepath) === FALSE) { + global $base_url; + $streamed_filepath = $base_url . '/' . $filepath; + } + else { + $streamed_filepath = $filepath; + } + // Prefering drupal_http_request() to file_get_contents(). + // drupal_http_request() needs an absolute path. In locales_source, however + // we store $filepath. + $file = drupal_http_request($streamed_filepath)->data; // Match all calls to Drupal.t() in an array. // Note: \s also matches newlines with the 's' modifier.