$endDate ) { unlink($logFile); // @codeCoverageIgnore } } $message = 'IP: ' . Request::ipv4(). ' | Subject: ' . $subject. ' | Date: '.Singleton::class('ZN\DateTime\Date')->set('{dayNumber0}.{monthNumber0}.{year} {H024}:{minute}:{second}'). ' | Message: ' . $message . EOL; return error_log($message, 3, $logFile); } /** * Convert high lighting * * @param string $str * @param array $settings * * @return string */ public static function highLight(string $str, array $settings = []) : string { $phpFamily = ! empty( $settings['php:family'] ) ? 'font-family:'.$settings['php:family'] : 'font-family:Consolas, monospace'; $phpSize = ! empty( $settings['php:size'] ) ? 'font-size:'.$settings['php:size'] : 'font-size:12px'; $phpStyle = ! empty( $settings['php:style'] ) ? $settings['php:style'] : ''; $htmlFamily = ! empty( $settings['html:family'] ) ? 'font-family:'.$settings['html:family'] : ''; $htmlSize = ! empty( $settings['html:size'] ) ? 'font-size:'.$settings['html:size'] : ''; $htmlColor = ! empty( $settings['html:color'] ) ? $settings['html:color'] : ''; $htmlStyle = ! empty( $settings['html:style'] ) ? $settings['html:style'] : ''; $comment = ! empty( $settings['comment:color'] ) ? $settings['comment:color'] : '#969896'; $commentStyle = ! empty( $settings['comment:style'] ) ? $settings['comment:style'] : ''; $default = ! empty( $settings['default:color'] ) ? $settings['default:color'] : '#000000'; $defaultStyle = ! empty( $settings['default:style'] ) ? $settings['default:style'] : ''; $keyword = ! empty( $settings['keyword:color'] ) ? $settings['keyword:color'] : '#a71d5d'; $keywordStyle = ! empty( $settings['keyword:style'] ) ? $settings['keyword:style'] : ''; $string = ! empty( $settings['string:color'] ) ? $settings['string:color'] : '#183691'; $stringStyle = ! empty( $settings['string:style'] ) ? $settings['string:style'] : ''; $background = ! empty( $settings['background'] ) ? $settings['background'] : ''; $tags = $settings['tags'] ?? true; ini_set("highlight.comment", "$comment; $phpFamily; $phpSize; $phpStyle; $commentStyle"); ini_set("highlight.default", "$default; $phpFamily; $phpSize; $phpStyle; $defaultStyle"); ini_set("highlight.keyword", "$keyword; $phpFamily; $phpSize; $phpStyle; $keywordStyle "); ini_set("highlight.string", "$string; $phpFamily; $phpSize; $phpStyle; $stringStyle"); ini_set("highlight.html", "$htmlColor; $htmlFamily; $htmlSize; $htmlStyle"); $string = highlight_string($str, true); $string = preg_replace ( ['/\&\#60\;script(.*?)\&\#62\;/i', '/\&\#60\;\/script\&\#62\;/i'], [''], str_replace ( ['', '?>'], ['<?', '?>'], htmlspecialchars_decode(trim($string), ENT_QUOTES) ) ); $tagArray = $tags === true ? ['