diff --git a/issue.php b/issue.php index c14e07a..54c9601 100644 --- a/issue.php +++ b/issue.php @@ -8,56 +8,24 @@ $body, - 'title' => $subject - ); - - $issueData = json_encode($rawData); - - // Prepare CURL - $curlConnection = curl_init('https://git.fjla.uk/api/v1/repos/fred.boniface/athena.fb-infra.uk/issues'); - curl_setopt($curlConnection, CURLOPT_POSTFIELDS, $issueData); - curl_setopt($curlConnection, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curlConnection, CURLOPT_HTTPHEADER, $httpHeaders); - - // Get response and exit CURL - $giteaResponse = curl_exec($curlConnection); - curl_close($curlConnection); - } - - function validate($data) { - $data = trim($data); - $data = stripslashes($data); - $data = htmlspecialchars($data); - return $data; + // Call POST function + sendInput($title,$body); } ?> @@ -74,7 +42,7 @@
" method="post"> Subject:
- +

Details: @@ -94,12 +62,6 @@
-

You have submitted:

-

REQUEST DATA: -
-
- JSON REPLY: -

diff --git a/php/submitIssue.php b/php/submitIssue.php index e1cae27..c73ac58 100644 --- a/php/submitIssue.php +++ b/php/submitIssue.php @@ -1,6 +1,6 @@ $body, - 'title' => $subject + 'title' => $title ); $preparedData = json_encode($rawData); @@ -32,3 +32,10 @@ function submitToGitea($title,$body) { return $response; } + +function cleanInput($data) { + $data = trim($data); + $data = stripslashes($data); + $data = htmlspecialchars($data); + return $data; +}