Skip to content

Commit

Permalink
Merge branch 'bugfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
bochoven committed Feb 2, 2015
2 parents a262ccf + 1bec9b6 commit cba6b60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function up()
$sql = "SELECT sql FROM sqlite_master WHERE type='table' AND name='machine'";
foreach($dbh->query($sql) as $arr)
{
$sql = preg_replace('/os_version[^V]* VARCHAR\(255\)/', 'os_version INT', $arr['sql'], 1, $changed);
$sql = preg_replace('/`os_version` VARCHAR\(255\)/', '`os_version` INT', $arr['sql'], 1, $changed);
if( ! $changed)
{
throw new Exception('Could not create temporary table as machine table is in an unknown state.');
Expand Down
10 changes: 8 additions & 2 deletions assets/js/munkireport.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ $( document ).ready(function() {
function integer_to_version(osvers)
{
osvers = "" + osvers
if( osvers !== '' && osvers.indexOf(".") == -1)
// If osvers contains a dot, don't convert
if( osvers.indexOf(".") == -1)
{
osvers = osvers.match(/.{2}/g).map(function(x){return +x}).join('.')
// Remove non-numerical string
osvers = isNaN(osvers) ? "" : osvers;

// Left pad with zeroes if necessary
osvers = ("000000" + osvers).substr(-6)
osvers = osvers.match(/.{2}/g).map(function(x){return +x}).join('.')
}
return osvers
}
Expand Down

0 comments on commit cba6b60

Please sign in to comment.