getSetting( 'TheWire', 'installDomain' ); $tag = strtolower( $matches[1] ); return "{$matches[0]}"; } public static function addTagLinks( $text ) { return preg_replace_callback( '@#([a-z][a-z0-9_-]+)@i', array( 'shareFormat', 'callbackAddTagLink' ), $text ); } public static function addPersonLinks( $text ) { $installDomain = $GLOBALS['ini']->getSetting( 'TheWire', 'installDomain' ); return preg_replace( '/@([a-z]+)/i', "\\0", $text ); } public static function addHtmlLinks( $text ) { $bugLinkFormat = str_replace( '%nr', '\\4', $GLOBALS['ini']->getSetting( 'formats', 'bugLinkFormat' ) ); $installDomain = $GLOBALS['ini']->getSetting( 'TheWire', 'installDomain' ); $text = preg_replace( '@((issue)|(bug))\s#([0-9]+)@i', "\\0", $text ); $text = preg_replace( "@(http://{$installDomain}/link/[0-9a-z]+)@i", "\\1", $text ); return $text; } public static function substituteLink( $text ) { $installDomain = $GLOBALS['ini']->getSetting( 'TheWire', 'installDomain' ); $text = preg_replace( '@{LINK,([0-9a-z]+)}@', "http://{$installDomain}/link/\\1", $text ); return $text; } }