summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2016-12-04 13:25:34 (GMT)
committerJoao Ventura2016-12-04 13:25:34 (GMT)
commitf23ac2f59ef585da16847658ffc522261e90d07e (patch)
tree06313d0e0b4094a597c501186c5dc00d95baf519
parent93e0a0ca55aaed8b61ab43c02da93632148611ec (diff)
Issue #2612372: Use DRUPAL_ROOT instead of dirname($_SERVER['SCRIPT_FILENAME'])
-rw-r--r--print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc b/print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc
index 459a711..33c9662 100644
--- a/print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc
+++ b/print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc
@@ -34,7 +34,7 @@ function print_pdf_tcpdf_print_pdf_generate($html, $meta, $paper_size = NULL, $p
define('K_TCPDF_EXTERNAL_CONFIG', TRUE);
}
if (!defined('K_PATH_MAIN')) {
- define('K_PATH_MAIN', dirname($_SERVER['SCRIPT_FILENAME']));
+ define('K_PATH_MAIN', DRUPAL_ROOT);
}
if (!defined('K_PATH_URL')) {
define('K_PATH_URL', $base_url);
@@ -159,7 +159,7 @@ function theme_print_pdf_tcpdf_header($vars) {
$logo = $logo_url[1];
// Make logo relative again.
- $logo = preg_replace("!^$base_url(.*)!sm", dirname($_SERVER['SCRIPT_FILENAME']) . '$1', $logo);
+ $logo = preg_replace("!^$base_url(.*)!sm", DRUPAL_ROOT . '$1', $logo);
if (!empty($logo)) {
$size = getimagesize($logo);