[Cs-versionparse-commits] SF.net SVN: cs-versionparse:[21] trunk/0.1/cs_version.abstract.class.php
Status: Inactive
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-06-11 01:10:24
|
Revision: 21 http://cs-versionparse.svn.sourceforge.net/cs-versionparse/?rev=21&view=rev Author: crazedsanity Date: 2009-06-11 01:09:58 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Fix some PHP notices for unit testing with error reporting set to E_ALL. /cs_version.abstract.class.php: * parse_version_string(): -- check for the presence of $pieces[2] before blindly using it to avoid PHP notices. Modified Paths: -------------- trunk/0.1/cs_version.abstract.class.php Modified: trunk/0.1/cs_version.abstract.class.php =================================================================== --- trunk/0.1/cs_version.abstract.class.php 2009-02-03 20:02:40 UTC (rev 20) +++ trunk/0.1/cs_version.abstract.class.php 2009-06-11 01:09:58 UTC (rev 21) @@ -157,10 +157,12 @@ $pieces = explode('.', $version); $retval = array( 'version_major' => $pieces[0], - 'version_minor' => $pieces[1], - 'version_maintenance' => $pieces[2] + 'version_minor' => $pieces[1] ); - if(!strlen($retval['version_maintenance'])) { + if(isset($pieces[2]) && strlen($pieces[2])) { + $retval['version_maintenance'] = $pieces[2]; + } + else { $retval['version_maintenance'] = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |