Commit 032b99d3 authored by jcnventura's avatar jcnventura

Issue #1098712: language negotiation constant warnings removed

parent e515a66b
......@@ -104,6 +104,8 @@ function print_pdf_controller() {
function _print_pdf_file_access_images($html) {
global $base_url, $language;
// TODO: This needs to be rewritten from scratch for Drupal 7
/*
// And converted from private to public paths
switch (variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE)) {
case LANGUAGE_NEGOTIATION_PATH_DEFAULT:
......@@ -115,16 +117,15 @@ function _print_pdf_file_access_images($html) {
break;
}
$file_downloads = variable_get('file_default_scheme', 'public');
// The following is broken in Drupal-7, since file_directory_path() doesn't exist anymore.
/* if ($file_downloads == 'private') {
if ($file_downloads == 'private') {
$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?)${base_url}/(?:(?:index.php)?\?q=)?(?:${lang}/)?system/files/([^>]*?>)!is";
$replacement = '$1file://' . realpath(file_directory_path()) . '/$2';
$html = preg_replace($pattern, $replacement, $html);
}*/
}
$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?)${base_url}/(?:(?:index.php)?\?q=)?(?:${lang}/)?([^>]*?>)!is";
$replacement = '$1file://' . dirname($_SERVER['SCRIPT_FILENAME']) . '/$2';
$html = preg_replace($pattern, $replacement, $html);
*/
return $html;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment