Пример #1
0
 function markNoConversion($text, $noParse = false)
 {
     if ($noParse || preg_match("/^https?:\\/\\/|ftp:\\/\\/|irc:\\/\\//", $text)) {
         return parent::markNoConversion($text);
     }
     return $text;
 }
Пример #2
0
	/**
	 * Prepare external link text for conversion. When the text is
	 * a URL, it shouldn't be converted, and it'll be wrapped in
	 * the "raw" tag (-{R| }-) to prevent conversion.
	 *
	 * This function is called "markNoConversion" for historical
	 * reasons.
	 *
	 * @param $text String: text to be used for external link
	 * @param $noParse bool: wrap it without confirming it's a real URL first
	 * @return string the tagged text
	 */
	public function markNoConversion( $text, $noParse = false ) {
		// Excluding protocal-relative URLs may avoid many false positives.
		if ( $noParse || preg_match( '/^(?:' . wfUrlProtocolsWithoutProtRel() . ')/', $text ) ) {
			return $this->mConverter->markNoConversion( $text );
		} else {
			return $text;
		}
	}
Пример #3
0
 /**
  * Enclose a string with the "no conversion" tag. This is used by
  * various functions in the Parser
  *
  * @param $text String: text to be tagged for no conversion
  * @param $noParse bool
  * @return string the tagged text
  */
 public function markNoConversion($text, $noParse = false)
 {
     return $this->mConverter->markNoConversion($text, $noParse);
 }
Пример #4
0
 function markNoConversion($text)
 {
     if (preg_match("/^https?:\\/\\/|ftp:\\/\\/|irc:\\/\\//", $text)) {
         return parent::markNoConversion($text);
     }
     return $text;
 }