"%2D", "/^\.$/" => "%2E", "/^0$/" => "%30", "/^1$/" => "%31", "/^2$/" => "%32", "/^3$/" => "%33", "/^4$/" => "%34", "/^5$/" => "%35", "/^6$/" => "%36", "/^7$/" => "%37", "/^8$/" => "%38", "/^9$/" => "%39", "/^@$/" => "%40", "/^A$/" => "%41", "/^B$/" => "%42", "/^C$/" => "%43", "/^D$/" => "%44", "/^E$/" => "%45", "/^F$/" => "%46", "/^G$/" => "%47", "/^H$/" => "%48", "/^I$/" => "%49", "/^J$/" => "%4A", "/^K$/" => "%4B", "/^L$/" => "%4C", "/^M$/" => "%4D", "/^N$/" => "%4E", "/^O$/" => "%4F", "/^P$/" => "%50", "/^Q$/" => "%51", "/^R$/" => "%52", "/^S$/" => "%53", "/^T$/" => "%54", "/^U$/" => "%55", "/^V$/" => "%56", "/^W$/" => "%57", "/^X$/" => "%58", "/^Y$/" => "%59", "/^Z$/" => "%5A", "/^_$/" => "%5F", "/^a$/" => "%61", "/^b$/" => "%62", "/^c$/" => "%63", "/^d$/" => "%64", "/^e$/" => "%65", "/^f$/" => "%66", "/^g$/" => "%67", "/^h$/" => "%68", "/^i$/" => "%69", "/^j$/" => "%6A", "/^k$/" => "%6B", "/^l$/" => "%6C", "/^m$/" => "%6D", "/^n$/" => "%6E", "/^o$/" => "%6F", "/^p$/" => "%70", "/^q$/" => "%71", "/^r$/" => "%72", "/^s$/" => "%73", "/^t$/" => "%74", "/^u$/" => "%75", "/^v$/" => "%76", "/^w$/" => "%77", "/^x$/" => "%78", "/^y$/" => "%79", "/^z$/" => "%7A" ); $chars = str_split($email); foreach ($chars as &$char) $char = preg_replace( array_keys($double_encode), array_values($double_encode), $char ); return $mailto.implode("", $chars); } /** * Function: twig_function_icon_img * Returns a URL to the requested icon resource. * * Parameters: * $filename - The icon filename. * $alt_text - The alternative text for the image. * $class - The CSS class for the link. */ function twig_function_icon_img( $filename, $alt_text = "", $class = null ): string { $url = Config::current()->chyrp_url. "/admin/images/icons/".$filename; $img = ''.fix($alt_text, true);

        if (isset($class) and $class !== false)
            $img.= ''; return $img; } /** * Function: twig_function_copyright_notice * Returns a copyright notice. * * Parameters: * $holder - The copyright holder's name. * $date1 - A date to use for the year. * $date2 - End date (for a span of years). */ function twig_function_copyright_notice( $holder = null, $date1 = null, $date2 = null, ): string { $notice = "©"; if (isset($date1)) { if (!is_numeric($date1)) $date1 = strtotime($date1); $year1 = _w("Y", $date1); $notice.= " ".$year1; if (isset($date2)) { if (!is_numeric($date2)) $date2 = strtotime($date2); if ($date1 < $date2) { $year2 = _w("Y", $date2); if (strcmp($year1, $year2) !== 0) $notice.= "–".$year2; } } } if (isset($holder)) $notice.= " ".$holder; return $notice; } /** * Function: twig_function_uploaded_search * Returns an array of matches, if the visitor has the "export_content" privilege. * * Parameters: * $search - A search term. * $filter - An array of valid extensions (case insensitive). */ function twig_function_uploaded_search( $search = "", $filter = array() ): array { if (!Visitor::current()->group->can("edit_post", "edit_page", true)) return array(); return uploaded_search($search, $filter); } /** * Function: twig_function_javascripts_nonce * Returns a nonce value to enable inline JavaScript with a Content Security Policy. */ function twig_function_javascripts_nonce(): string { $nonce = ""; return Trigger::current()->filter($nonce, "javascripts_nonce"); } /** * Function: twig_function_stylesheets_nonce * Returns a nonce value to enable inline stylesheets with a Content Security Policy. */ function twig_function_stylesheets_nonce(): string { $nonce = ""; return Trigger::current()->filter($nonce, "stylesheets_nonce"); } /** * Function: twig_filter_translate * Returns a translated string. * * Parameters: * $text - The string to translate. * $domain - The translation domain to read from. */ function twig_filter_translate( $string, $domain = null ): string { if (!isset($domain)) $domain = (ADMIN) ? "admin" : Theme::current()->safename ; return __($string, $domain); } /** * Function: twig_filter_translate_plural * Returns a plural (or not) form of a translated string. * * Parameters: * $single - Singular string. * $plural - Pluralized string. * $number - The number to judge by. * $domain - The translation domain to read from. */ function twig_filter_translate_plural( $single, $plural, $number, $domain = null ): string { if (!isset($domain)) $domain = (ADMIN) ? "admin" : Theme::current()->safename ; return _p($single, $plural, $number, $domain); } /** * Function: twig_filter_time * Returns a