/** * Normalize reference label * * This enables case-insensitive label matching * * @param string $string * * @return string */ public static function normalizeReference($string) { // Collapse internal whitespace to single space and remove // leading/trailing whitespace $string = preg_replace('/\\s+/', '', trim($string)); return Typecho_Common::strToUpper($string, 'UTF-8'); }