[Patch] pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php
| From: | Jay Taylor | Date: | Tue, 07 Nov 2006 22:24:28 +0000 |
| Subject: | [Patch] pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-44867@lists.php.net to get a copy of this message | ||
Greetings,
I have made 1 relatively minor modification to the pear CVS file:
pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php
This simple 1 line modification consists of appending 1 entry to the
schemes array. Tis entry makes it possible for Mediawiki to parse links
which use the following syntax:
[//pear.php.net Pear::Homepage]
The URL specification states that double-forwardslashes (aka
forwardslash-forwardslash, "//") signifies that the URI inherit its scheme
from the current base url.
The URL specification from W3C can be at the w3.org website:
http://www.w3.org/Addressing/URL/url-spec.txt
The relevant section can be found near the beginning of the document. The
tree path to to this section is:
http://www.w3.org/Addressing/URL/url-spec.txt
Recommendations
URL SYNTAX
Internet protocol parts
-Examples-
If we were presently at https://example.com/index.php, and this page
renders a Mediawiki link which has the wiki form of
"[//images.example.com/hello.jpg]", the specification would dictate that the
URI resolve to https://images.example.com/hello.jpg.
As a supplementary example, if we were presently at
http://example.com/index.php, and this page renders a
Mediawiki link which
has the wiki form of "[//images2.example.com/hello2.jpg]", the specification
would dictate that the URI resolve to http://images2.example.com/hello2.jpg.
-Optional Reading-
And for those of you who may be interested in this kind of thing, I found
http://www.w3.org/DesignIssues/Axioms.html
to be an interesting read
regarding URI schemes (even though the document appears to be a decade old
by now and is not official).
This is my first patch, so please forgive any wrongdoing on my part. I have
put forth my best effort to follow the protocol outlined at feedback
regarding any
? Url.diff Index: Url.php =================================================================== RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php,v retrieving revision 1.2 diff -u -r1.2 Url.php --- Url.php 15 Aug 2006 16:02:06 -0000 1.2 +++ Url.php 7 Nov 2006 22:03:50 -0000 @@ -67,6 +67,7 @@ */ var $conf = array( 'schemes' => array( + '//', // inherits scheme of the base url 'http://', 'https://', 'ftp://',
? Url.diff Index: Url.php =================================================================== RCS file: /repository/pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php,v retrieving revision 1.2 diff -u -r1.2 Url.php --- Url.php 15 Aug 2006 16:02:06 -0000 1.2 +++ Url.php 7 Nov 2006 22:03:50 -0000 @@ -67,6 +67,7 @@ */ var $conf = array( 'schemes' => array( + '//', // inherits scheme of the base url 'http://', 'https://', 'ftp://',