[pLog-svn] r4961 - plog/branches/lifetype-1.2/class/data/validator/rules
Jon Daley
plogworld at jon.limedaley.com
Sat Mar 3 19:16:39 EST 2007
?? I am running 1.2, svn rev 4965, and I get the tests pass, ie.
"http://" is correctly reported as invalid.
On Sun, 4 Mar 2007, Oscar Renalias wrote:
> It looks better now, but a URL such as "http:// " is being reported
> as valid.
>
> On 4 Mar 2007, at 01:27, jondaley at devel.lifetype.net wrote:
>
>> Author: jondaley
>> Date: 2007-03-03 18:27:01 -0500 (Sat, 03 Mar 2007)
>> New Revision: 4961
>>
>> Modified:
>> plog/branches/lifetype-1.2/class/data/validator/rules/
>> urlformatrule.class.php
>> Log:
>> configure some options for how we want it, and fix one bug. I'll
>> email the author with this change
>>
>> Modified: plog/branches/lifetype-1.2/class/data/validator/rules/
>> urlformatrule.class.php
>> ===================================================================
>> --- plog/branches/lifetype-1.2/class/data/validator/rules/
>> urlformatrule.class.php 2007-03-03 23:25:04 UTC (rev 4960)
>> +++ plog/branches/lifetype-1.2/class/data/validator/rules/
>> urlformatrule.class.php 2007-03-03 23:27:01 UTC (rev 4961)
>> @@ -67,7 +67,11 @@
>>
>> /* Set up default options */
>> $options = array_merge(array(/**/
>> - 'AllowedProtocols' => array(), /
>> * array('http', 'https', etc...) always lcase! */
>> + /* array('http', 'https',
>> etc.) always lcase! */
>> + 'AllowedProtocols' =>
>> + array('http', 'https', 'ftp',
>> 'mailto',
>> + 'file', 'news', 'gopher',
>> 'telnet',
>> + 'nntp'),
>> 'AllowBracks' => false, /*
>> Allow square brackets in the query string ? */
>> 'Protocols' => array('http',
>> 'https', 'ftp', 'mailto', 'file', 'news', 'gopher', 'telnet',
>> 'nntp'), /**/
>> 'AssumeProtocol' => false, /**/
>> @@ -75,7 +79,7 @@
>>
>> /* Setup default values for $options['Require]*/
>> @ $options['Require'] = array_merge(array(/**/
>> - 'Protocol' =>
>> false, /**/
>> + 'Protocol' =>
>> true, /**/
>> 'User' => false, /**/
>> 'Password' =>
>> false, /**/
>> 'Server' => true, /
>> **/
>> @@ -371,7 +375,7 @@
>>
>> $tmp = preg_replace('/[^a-z0-9]$/', '', $tmp);
>>
>> - if ($tmp != $serverParts[$i])
>> + if ($serverParts[$i] == '' || $tmp !=
>> $serverParts[$i])
>> {
>> if ($tmp != '')
>> $serverParts[$i] = $tmp;
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://limedaley.com/mailman/listinfo/plog-svn
>>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
--
Jon Daley
http://jon.limedaley.com/
Just because the standard provides a cliff in front of you, you are
not necessarily required to jump off it.
-- Norman Diamond
More information about the pLog-svn
mailing list