Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Latest commit

 

History

History
executable file
·
38 lines (20 loc) · 1.01 KB

README.md

File metadata and controls

executable file
·
38 lines (20 loc) · 1.01 KB

This is a very basic MediaWiki extension that exposes the PHP parse_url functions.

http://php.net/manual/en/function.parse-url.php

Usage

{{#parseurl: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | host}}

Returns www.youtube.com

{{#parseurl: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | scheme}}

Returns http

{{#parseurl: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | path}}

Returns /watch

{{#parseurl: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | query}}

Returns v=C4kxS1ksqtw&feature=relate

{{#parseurl: http://username:password@hostname/path?arg=value#anchor | fragment}}

Returns anchor

{{#parseurl: http://username:password@hostname/path?arg=value#anchor | anchor}}

Returns nothing.

{{#parseurlquery: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | v}}

Returns C4kxS1ksqtw

{{#parseurlquery: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=relate | bar}}

Returns nothing.