本日作業分

This commit is contained in:
2023-09-01 01:53:54 +09:00
parent 50996316e5
commit d13588c24f
13 changed files with 170 additions and 13 deletions
+9 -3
View File
@@ -1,17 +1,19 @@
<?php
define ('SAVE_DIR', 'draft/');
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/drafts/");
$json = getParamJSON ();
if (!(isset ($json['data'])))
{
sendResult (false, 'Empty query Parameter: data');
exit (1);
}
if (!(preg_match ('/^data:image\/png;base64,/', $json['data'])))
{
sendResult (false, 'Not Allow data type: data');
exit (1);
}
@@ -27,7 +29,8 @@ setcookie ('backup', $file, time () + 60 * 60 * 24 * 30);
function
getParamJSON ()
getParamJSON ():
array
{
$buff = file_get_contents ('php://input');
$json = json_decode ($buff, true);
@@ -36,7 +39,10 @@ getParamJSON ()
}
function
sendResult ($status, $data)
sendResult (
$status,
$data):
string
{
header ('Access-Control-Allow-Origin: *');
header ('Access-Control-Allow-Headers: *');
+1 -1
View File
@@ -37,5 +37,5 @@ if (!(empty ($_POST['thread-name'])))
$mysqli -> close ();
}
header ("location: ./?thread=$current");
header ("location: ../?thread=$current");
+2 -2
View File
@@ -2,10 +2,10 @@
require "${_SERVER['DOCUMENT_ROOT']}/database.php";
define ('SAVE_DIR', 'image/'); // 保存ディレクトリ定義
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/images/"); // 保存ディレクトリ定義
$thread = $_GET['thread'];
file_put_contents ('log.txt', $thread);
// file_put_contents ('log.txt', $thread);
$json = getParamJSON (); // JSON パラメタ