From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg

Release status: beta
Implementation Parser function
Description Gives validations for URL.
License No license specified
Download No link
Translate the Ommswiki extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

Gives validations for URL.



Retrieves value in the input box and validate it.Returns the result true or false ,if valid or not.



url which you want to validate.

Download instructions[edit]

Please cut and paste the code found below and place it in $IP/extensions/ExtensionName/ExtensionName.php. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.


To install this extension, add the following to LocalSettings.php:

#add configuration parameters here
#setup user rights here

Configuration parameters[edit]

User rights[edit]



$wgURLfunction = 'wfurl';

$wgExtensionCredits['parserhook'][] = array(
	'name' => 'Ommswiki',
	'version' => '1.0',
	'url' => 'http://www.mediawiki.org/wiki/Extension:Ommswiki',
	'author' => 'yashashri',   
	'description' => 'Defines an validation for url.'
function wgURLfunction() {
	global $wgParser, $wgExtDynamicFunctions;
	$wgExtDynamicFunctions = new ExtURLfunction();
	$wgParser->setFunctionHook( 'URL', array( &$wgExtDynamicFunctions, 'URL' ) );
function wfURLfunctionLanguageGetMagic( &$magicWords, $langCode ) {
	switch ( $langCode ) {
		$magicWords['URL']    = array( 0, 'URL' );
	return true;
class ExtDynamicFunctions {
	function arg( &$parser, $text = '', $value = '' ) {
		global $wgRequest;
		return $wgRequest->getVal($text, $value);

See also[edit]