$head_tag = ! empty($head_tags) ? join("\n", $head_tags) ."\n" : ''; // 1.3.x compat // Last modification date (UNIX timestamp) of the page $fmt = $is_read ? get_filetime($_page) + LOCALZONE : 0; // Output nofollow / noindex regardless os skin file if (!$is_read || $nofollow) { if (!headers_sent()) { header("X-Robots-Tag: noindex,nofollow"); } } // Send Canonical URL for Search Engine Optimization if ($is_read && !headers_sent()) { header("Link: <$canonical_url>; rel=\"canonical\""); } // Search words if ($search_word_color && isset($vars['word'])) { $body = '
' . $_msg_word . htmlsc($vars['word']) . '
' . $hr . "\n" . $body; // BugTrack2/106: Only variables can be passed by reference from PHP 5.0.5 // with array_splice(), array_flip() $words = preg_split('/\s+/', $vars['word'], -1, PREG_SPLIT_NO_EMPTY); $words = array_splice($words, 0, 10); // Max: 10 words $words = array_flip($words); $keys = array(); foreach ($words as $word=>$id) $keys[$word] = strlen($word); arsort($keys, SORT_NUMERIC); $keys = get_search_words(array_keys($keys), TRUE); $id = 0; foreach ($keys as $key=>$pattern) { $s_key = htmlsc($key); $pattern = '/' . ']*>.*?<\/textarea>' . // Ignore textareas '|' . '<[^>]*>' . // Ignore tags '|' . '&[^;]+;' . // Ignore entities '|' . '(' . $pattern . ')' . // $matches[1]: Regex for a search word '/sS'; $decorate_Nth_word = create_function( '$matches', 'return (isset($matches[1])) ? ' . '\'\' . $matches[1] . \'\' : ' . '$matches[0];' ); $body = preg_replace_callback($pattern, $decorate_Nth_word, $body); $notes = preg_replace_callback($pattern, $decorate_Nth_word, $notes); ++$id; } } // Embed Scripting data $html_scripting_data = get_html_scripting_data(); // Compat: 'HTML convert time' without time about MenuBar and skin $taketime = elapsedtime(); require(SKIN_FILE); } /** * Get data used by JavaScript modules */ function get_html_scripting_data() { global $ticket_link_sites; if (!isset($ticket_link_sites) || !is_array($ticket_link_sites)) { return ''; } // Require: PHP 5.4+ if (!defined('JSON_UNESCAPED_UNICODE')) { return ''; }; $text = ''; foreach ($ticket_link_sites as $s) { if (!preg_match('/^([a-zA-Z0-9]+)([\.\-][a-zA-Z0-9]+)*$/', $s['key'])) { continue; } $site_info_json = htmlsc(json_encode($s, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); $text .= << EOS; $text .= "\n"; } $data = <<