ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-dev
pear-dev
[PEAR-DEV] [Patch] [Finished] pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php
by Jay Taylor other posts by this author
Nov 7 2006 2:59PM messages near this date
Re: [PEAR-DEV] Account Request | [PEAR-DEV] XML_Validator Issue
Greetings,
  I have made one relatively minor modification to the pear CVS file:
pear/Text_Wiki/Text/Wiki/Parse/Mediawiki/Url.php


Verbose Explanation:
====================
  This simple change consists of appending a single entry to the schemes
array which makes it possible for Mediawiki to parse links which use the
following syntax:
  [//pear.php.net Pear::Homepage]

The W3C document which discusses the resolution of partial URLs can be found
at http://www.w3.org/Addressing/URL/4_3_Partial.html.  The portion of this
document which is relevant for the purposes of this patch is the following
statement:
``If the scheme parts are different, the whole absolute URI must be given.
Otherwise, the scheme is omitted, ..``

The URL definition (from the official W3 specifications) seems to support
legitimacy of the aforementioned document as it states that it does not
define the resolution of fragmented or partial URLs. This document can be
found at http://www.w3.org/Addressing/URL/url-spec.txt.  The specific quote
is:
``Fragment identifiers and partial URLs are not involved in the basic
   URL definition.``


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.


Testing Methodology:
====================
  I am basically proposing that we add the ability to omit the scheme from a
url to be able to inherit from the proper document.  I have verified that
this works as described in the examples above through testing on my own
apache webserver.  My tests concluded that if one is to use a url in an
xhtml document which has the form of:
"//fully.qualified.ip.org.dns.entry/resource/specific_one", the url scheme
gets inherited from whatever scheme the document was accessed with (I tested
that this works for both Internet Explorer 6 and Firefox 1.5).  Testing was
performed by executing queries equivalent to the examples and then checking
the logs to verify the appropriate scheme had been used each time. 


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).


Final Thoughts:
===============
This is my first patch, so please forgive the general excessiveness and/or
any wrongdoing on my part.  I have put forth my best effort to follow the
protocol outlined at http://pear.php.net/manual/en/contributing.patches.php.
I welcome constructive feedback regarding how I can improve any future
patches.

Thanks,
Jay

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved