コード例 #1
0
    $rspec_id = $_GET['id'];
}
$rspec_contents = NULL;
if (array_key_exists("rspec", $_GET)) {
    $rspec_contents = $_GET['rspec'];
}
$rspec_tempfile = NULL;
if (array_key_exists('tempfile', $_GET)) {
    $rspec_tempfile = $_GET['tempfile'];
}
if (is_null($rspec_id && is_null($rspec_contents))) {
    relative_redirect('home.php');
}
/* $rspec is the XML */
if (!is_null($rspec_id)) {
    $rspec = fetchRSpecById($rspec_id);
    $name = fetchRSpecNameById($rspec_id);
} else {
    if (!is_null($rspec_tempfile)) {
        // Get the canonical path without symlinks or '.' or '..'
        $rspec_tempfile = realpath($rspec_tempfile);
        /* See saverspectoserver.php */
        // Perform a modicum of validation. Yes, we could do more.
        if (strpos($rspec_tempfile, '/tmp/saverspectoserver') !== 0) {
            error_log("Not allowing download of rspec_tempfile {$rspec_tempfile}");
            header('Not Found', true, 404);
            exit;
        }
        $rspec = file_get_contents($rspec_tempfile);
        $name = "";
        // This is a one-time get file: it is written and then deleted when downloaded
コード例 #2
0
//
// THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
// IN THE WORK.
//----------------------------------------------------------------------
require_once "header.php";
require_once "settings.php";
require_once "user.php";
require_once "file_utils.php";
require_once "sr_client.php";
require_once "sr_constants.php";
require_once "am_client.php";
require_once "sa_client.php";
require_once "am_map.php";
require_once "json_util.php";
require_once "query-details.php";
require_once "print-text-helpers.php";
include "status_constants.php";
if (array_key_exists('rspec_id', $_REQUEST)) {
    $rspec = fetchRSpecById($_REQUEST['rspec_id']);
    //  $rspec = str_replace(array("\n", "\r", "\t"), '', $rspec);
    //  $rspec = trim(str_replace('"', "'", $rspec));
    print $rspec;
} else {
    print 'null';
}