Re: svn: /web/php/trunk/ svn-php.php

From: Date: Thu, 09 Jun 2011 14:54:14 +0000
Subject: Re: svn: /web/php/trunk/ svn-php.php
References: 1 2  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-11165@lists.php.net to get a copy of this message
On Jun 9, 2011, at 7:30 AM, Hannes Magnusson wrote: > On Thu, Jun 9, 2011 at 16:10, Philip Olson <philip@php.net> wrote: >> philip Thu, 09 Jun 2011 14:10:38 +0000 >> >> Revision: >> http://svn.php.net/viewvc?view=revision&revision=311976 >> >> Log: >> Added requirement to choose a group. Defaults to 'Choose One' >> >> Changed paths: >> U web/php/trunk/svn-php.php >> >> Modified: web/php/trunk/svn-php.php >> =================================================================== >> --- web/php/trunk/svn-php.php 2011-06-09 13:09:25 UTC (rev 311975) >> +++ web/php/trunk/svn-php.php 2011-06-09 14:10:38 UTC (rev 311976) >> @@ -23,6 +23,7 @@ >> site_header("Using SVN for PHP Development", array("current" => >> "FIXME")); >> >> $groups = array( >> + "none" => "Choose One", >> "php" => "PHP Group", >> "pear" => "PEAR Group", >> "pecl" => "PECL Group", >> @@ -72,7 +73,7 @@ >> if (empty($_POST['yesno']) || $_POST['yesno'] != 'yes') { >> $error .= "You did not fill the form out correctly. <br />"; >> } >> - if (empty($_POST['group']) || !isset($groups[$_POST['group']])) { >> + if (empty($_POST['group']) || $_POST['group'] === 'none' >> || !isset($groups[$_POST['group']])) { > > shouldn't it be the other way around; !isset() || == none ? It could, but doesn't matter because 'none' was added to $groups. However, I think group equalling 'none' is more common than someone inserting a custom group name. Now whether adding a non-group to $groups is wise is another story, but it is simple and friendly to code below, and is the default selection. Regards, Philip

« previous php.webmaster (#11165) next »