Commit 5dbe34ac authored by Chad Barb's avatar Chad Barb

Fixed error when specifying non-existant temp ns file id to spitnsdata.php3

(i.e. copy-and-pasting in an URL with the last digit of the ID truncated.)

Also changed one line of top2image.php3 to be <80 columns wide.
parent 6f9106bd
......@@ -27,17 +27,22 @@ if (isset($nsdata) && strcmp($nsdata, "") != 0) {
header("Content-Type: text/plain");
echo "$nsdata";
} elseif (isset($nsref) && strcmp($nsref,"") != 0 && ereg("^[0-9]+$", $nsref)) {
$nsfile = "/tmp/$uid-$nsref.nsfile";
if (! ($fp = fopen($nsfile, "r"))) {
TBERROR("Could not read temporary file $nsfile", 1);
$nsfile = "/tmp/$uid-$nsref.nsfile";
if (! file_exists($nsfile)) {
PAGEHEADER("View Generated NS File");
USERERROR("Could not find temporary file \"$nsfile\"<br>" .
"(Did you copy and paste an URL incorrectly?)", 1);
PAGEFOOTER();
} else {
$fp = fopen($nsfile, "r");
header("Content-Type: text/plain");
$contents = fread ($fp, filesize ($nsfile));
fclose($fp);
echo "$contents";
}
} else {
PAGEERROR("No NS file provided!");
USERERROR("No NS file provided!",1);
}
?>
......
......@@ -72,7 +72,8 @@ if ($detail != 0) { $detailstring = "-d $detail"; } else { $detailstring = ""; }
# Spit out the image with a content header.
#
if ($fp = popen("$TBSUEXEC_PATH $uid $gid webvistopology $detailstring -z $zoom $pid $eid", "r")) {
if ($fp = popen("$TBSUEXEC_PATH $uid $gid webvistopology " .
"$detailstring -z $zoom $pid $eid", "r")) {
header("Content-type: image/png");
fpassthru($fp);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment