diff --git a/include/class.pdf.php b/include/class.pdf.php index 51a752a15df8226bc585e668cb0cd0043d9fc584..404e4dd7bd942ad0114a919fe0efec83d1c83a28 100644 --- a/include/class.pdf.php +++ b/include/class.pdf.php @@ -56,7 +56,7 @@ class Ticket2PDF extends mPDF return INCLUDE_DIR.'fpdf/print-logo.png'; } - $tmp = tempnam("", 'pdf') . '.jpg'; + $tmp = tempnam(sys_get_temp_dir(), 'pdf') . '.jpg'; $img = imagecreatefromstring($logo->getData()); // Handle transparent images with white background $img2 = imagecreatetruecolor(imagesx($img), imagesy($img)); diff --git a/include/class.validator.php b/include/class.validator.php index c41058e057f51731a994387517d0835de40f137d..4349da3d84efb0b7d83835eca6682ddcd215a4aa 100644 --- a/include/class.validator.php +++ b/include/class.validator.php @@ -177,7 +177,7 @@ class Validator { function is_username($username, &$error='') { if (strlen($username)<2) $error = 'At least two (2) characters'; - elseif (!preg_match('/^[\w._-]+$/', $username)) + elseif (!preg_match('/^[\p{L}._-]+$/u', $username)) $error = 'Username contains invalid characters'; return $error == ''; } diff --git a/include/html2text.php b/include/html2text.php index b4486ed9fabf0fc8b37761baa8b50d23b669fa26..0c1ec08330d8a8c77acd80d1f187d6b6c0d7d4a4 100644 --- a/include/html2text.php +++ b/include/html2text.php @@ -201,7 +201,7 @@ class HtmlInlineElement { case 'normal': default: if ($after_block) $more = ltrim($more); - $more = preg_replace('/\s+/m', ' ', $more); + $more = preg_replace('/[ \r\n\t\f]+/mu', ' ', $more); } } elseif ($c instanceof HtmlInlineElement) { diff --git a/include/staff/slaplan.inc.php b/include/staff/slaplan.inc.php index 0f0e7b5425cfa3b9712095d51eedffc579e9e159..0aac8b778005cc61644f57f39fe77e4d07fcee7c 100644 --- a/include/staff/slaplan.inc.php +++ b/include/staff/slaplan.inc.php @@ -15,7 +15,7 @@ if($sla && $_REQUEST['a']!='add'){ $submit_text='Add Plan'; $info['isactive']=isset($info['isactive'])?$info['isactive']:1; $info['enable_priority_escalation']=isset($info['enable_priority_escalation'])?$info['enable_priority_escalation']:1; - $info['disable_overdue_alerts']=isset($info['disable_overdue_alerts'])?$info['disable_overdue_alerts']:1; + $info['disable_overdue_alerts']=isset($info['disable_overdue_alerts'])?$info['disable_overdue_alerts']:0; $qstr.='&a='.urlencode($_REQUEST['a']); } $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);