Changeset 2686


Ignore:
Timestamp:
5/25/2012 1:00:04 AM (3 years ago)
Author:
lowjoel
Message:

Retain the extension of the uploaded crash report. We accept two now: .tar.7z and .tar.bz2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/website/scripts/blackbox/upload.php

    r2096 r2686  
    136136 
    137137    //Move the temporary file to out dumps folder for later inspection 
    138     if (!move_uploaded_file($crashReport['tmp_name'], 'dumps/' . $reportId . '.tbz')) 
     138    $localName = $crashReport['name']; 
     139    $lastDot = strrpos($localName, '.'); 
     140    if ($lastDot !== false) 
     141        $localExt = substr($localName, strrpos($localName, '.') + 1); 
     142    else 
     143        $localExt = 'bz2'; 
     144    if (!move_uploaded_file($crashReport['tmp_name'], 'dumps/' . $reportId . '.tar.' . $localExt)) 
    139145        throw new Exception('Could not store crash dump onto server.'); 
    140146} 
Note: See TracChangeset for help on using the changeset viewer.