Skip to content

Commit

Permalink
add word gen
Browse files Browse the repository at this point in the history
  • Loading branch information
shouc committed Mar 27, 2020
1 parent 9485bce commit 401d0b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/word.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
require_once __DIR__ . "/../utils/user-level.php";

$doc_name = $_GET["doc_name"];
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment; Filename=$doc_name.doc");
// No XSS, log can catch you!
$user_id = wp_get_current_user()->ID;
if (!authorize("contributor")){
wp_send_json(
array(
"success" => false,
"message" => "Not authorized",
)
);
}

echo base64_decode($_GET["content"]);

0 comments on commit 401d0b5

Please sign in to comment.