-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport.php~
More file actions
32 lines (32 loc) · 1.34 KB
/
Copy pathimport.php~
File metadata and controls
32 lines (32 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
session_start();
if (isset($_FILES["upload-file"]))
{
var_dump($_FILES["upload-file"]["type"]);
if ($_FILES["upload-file"]["type"]=="text/rtf" || $_FILES["upload-file"]["type"]=="application/rtf" || ($_FILES["upload-file"]["type"]=="application/msword" && stristr($_FILES["upload-file"]["name"],".rtf")!=FALSE))
{
$cmd="unrtf ". $_FILES["upload-file"]["tmp_name"];
exec($cmd,$html);
$html=implode($html);
$html=str_replace("<!---","<!--",$html);
$html=str_replace("--->","-->",$html);
}
else if ($_FILES["upload-file"]["type"]=="application/xml" || $_FILES["upload-file"]["type"]=="text/xml" || $_FILES["upload-file"]["type"]=="text/html" || $_FILES["upload-file"]["type"]=="application/sgml" || $_FILES["upload-file"]["type"]=="text/sgml" || $_FILES["upload-file"]["type"]=="text/plain")
{
$html=implode(file($_FILES["upload-file"]["tmp_name"]));
}
else
{
echo "<h1>Ungültiges Dateiformat: ".$_FILES["upload-file"]["type"]."</h1>";
}
$_SESSION["data"]=$html;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="0; URL=index.php">
</head>
</html>