Project

General

Profile

Feature #35822 » patch-35822.diff

Patch for issue #35822 - Michael Schams, 2012-04-10 14:35

View differences:

t3lib/utility/class.t3lib_utility_versionnumber.php
$versionParts = explode('.', $versionNumber);
return intval((int) $versionParts[0] . str_pad((int) $versionParts[1], 3, '0', STR_PAD_LEFT) . str_pad((int) $versionParts[2], 3, '0', STR_PAD_LEFT));
}
/**
* Returns the three part version number (string) from an integer, eg 4012003 -> '4.12.3'
*
* @param $versionInteger integer Integer representation of version number
* @return mixed Version number as format x.x.x or FALSE if integer can not converted (error)
*/
public static function convertIntegerToVersionNumber($versionInteger = NULL) {
if(is_numeric($versionInteger) && $versionInteger > 1000000) {
$versionString = str_pad($versionInteger, 9, '0', STR_PAD_LEFT);
$parts = array(
substr($versionString, 0, 3),
substr($versionString, 3, 3),
substr($versionString, 6, 3)
);
return intval($parts[0]) . '.' . intval($parts[1]) . '.' . intval($parts[2]);
}
return FALSE;
}
}
?>
?>
(2-2/2)