From fe984d19a32486bb72c6489fab3bd26a2dd3b3f2 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 6 Jul 2020 11:18:11 +0200 Subject: [PATCH] Additional 7.4 compatibility fixes. --- includes/session.inc | 2 +- includes/ui/ui_lists.inc | 2 +- reporting/includes/tcpdf.php | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/session.inc b/includes/session.inc index 06acecce..21c402e0 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -312,7 +312,7 @@ function set_page_security($value=null, $trans = array(), $gtrans = array()) // function strip_quotes($data) { - if(get_magic_quotes_gpc()) { + if(version_compare(phpversion(), '5.4', '<') && get_magic_quotes_gpc()) { if(is_array($data)) { foreach($data as $k => $v) { $data[$k] = strip_quotes($data[$k]); diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 55ef6777..417d6032 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -158,7 +158,7 @@ $opts = array( // default options // sql completion if (count($opts['where'])) { $where = strpos($sql, 'WHERE')==false ? ' WHERE ':' AND '; - $where .= '('. implode($opts['where'], ' AND ') . ')'; + $where .= '('. implode(' AND ', $opts['where']) . ')'; $group_pos = strpos($sql, 'GROUP BY'); if ($group_pos) { $group = substr($sql, $group_pos); diff --git a/reporting/includes/tcpdf.php b/reporting/includes/tcpdf.php index 71fb75ef..01d15527 100644 --- a/reporting/includes/tcpdf.php +++ b/reporting/includes/tcpdf.php @@ -1124,7 +1124,8 @@ if (!class_exists('TCPDF')) { mb_internal_encoding("ASCII"); } // set language direction - $this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; + + $this->rtl = @$this->l['a_meta_dir']=='rtl' ? true : false; $this->tmprtl = false; //Some checks $this->_dochecks(); @@ -3520,6 +3521,8 @@ if (!class_exists('TCPDF')) { function unichr($c) { if (!$this->isunicode) { return chr($c); + } elseif ($c == '') { + return ''; } elseif ($c <= 0x7F) { // one byte return chr($c); -- 2.30.2