Merge remote-tracking branch 'refs/remotes/origin/deploy_spamnoticer' into deploy_spamnoticer

This commit is contained in:
Jon 2024-02-26 18:48:32 +00:00
commit 00c37364c6
No known key found for this signature in database
GPG Key ID: 0175F5C9B8E9F984
4 changed files with 10 additions and 4 deletions

View File

@ -130,8 +130,9 @@ class Api {
}
}
private function translatePost($post, $threadsPage = false) {
function translatePost($post, $threadsPage = false) {
global $config, $board;
$apiPost = array();
$fields = $threadsPage ? $this->threadsPageFields : $this->postFields;
$this->translateFields($fields, $post, $apiPost);

View File

@ -380,6 +380,10 @@ class PostProps {
class Post extends PostProps {
private $op;
private $raw_body;
private $has_file;
private $tracked_cites;
public function __construct($post, $root=null, $mod=false) {
global $config;

View File

@ -563,7 +563,7 @@ $config['filters'][] = array(
$config['filters'][] = array(
'condition' => array(
'body' => '/(^|\s)((https?):\/\/)?[\w-]{2,6}\.[a-z]{2,4}\/\w{2,8}/i', // url shorteners are not allowed
'body' => '/(^|\s)((https?):\/\/)?[\w-]{2,6}\.[a-z]{2,4}\/\w{2,8}(\s|$)/i', // url shorteners are not allowed
),
'action' => 'reject',
'message' => 'Url shorteners are not allowed'

View File

@ -458,7 +458,6 @@ function handle_post(){
global $config,$dropped_post,$board, $mod,$pdo;
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
print_err('handle_post bot error 1');
error($config['error']['bot']);
}
@ -1488,10 +1487,12 @@ function handle_post(){
header('Location: ' . $redirect, true, $config['redirect_http']);
} else {
header('Content-Type: text/json; charset=utf-8');
$api = new Api();
echo json_encode(array(
'redirect' => $redirect,
'noko' => $noko,
'id' => $id
'id' => $id,
'post' => $api->translatePost(new Post($post))
));
}