Merge remote-tracking branch 'refs/remotes/origin/deploy_spamnoticer' into deploy_spamnoticer
This commit is contained in:
commit
00c37364c6
|
@ -130,8 +130,9 @@ class Api {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function translatePost($post, $threadsPage = false) {
|
function translatePost($post, $threadsPage = false) {
|
||||||
global $config, $board;
|
global $config, $board;
|
||||||
|
|
||||||
$apiPost = array();
|
$apiPost = array();
|
||||||
$fields = $threadsPage ? $this->threadsPageFields : $this->postFields;
|
$fields = $threadsPage ? $this->threadsPageFields : $this->postFields;
|
||||||
$this->translateFields($fields, $post, $apiPost);
|
$this->translateFields($fields, $post, $apiPost);
|
||||||
|
|
|
@ -380,6 +380,10 @@ class PostProps {
|
||||||
|
|
||||||
|
|
||||||
class Post extends PostProps {
|
class Post extends PostProps {
|
||||||
|
private $op;
|
||||||
|
private $raw_body;
|
||||||
|
private $has_file;
|
||||||
|
private $tracked_cites;
|
||||||
|
|
||||||
public function __construct($post, $root=null, $mod=false) {
|
public function __construct($post, $root=null, $mod=false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
|
@ -563,7 +563,7 @@ $config['filters'][] = array(
|
||||||
|
|
||||||
$config['filters'][] = array(
|
$config['filters'][] = array(
|
||||||
'condition' => 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',
|
'action' => 'reject',
|
||||||
'message' => 'Url shorteners are not allowed'
|
'message' => 'Url shorteners are not allowed'
|
||||||
|
|
5
post.php
5
post.php
|
@ -458,7 +458,6 @@ function handle_post(){
|
||||||
global $config,$dropped_post,$board, $mod,$pdo;
|
global $config,$dropped_post,$board, $mod,$pdo;
|
||||||
|
|
||||||
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
|
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
|
||||||
print_err('handle_post bot error 1');
|
|
||||||
error($config['error']['bot']);
|
error($config['error']['bot']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1488,10 +1487,12 @@ function handle_post(){
|
||||||
header('Location: ' . $redirect, true, $config['redirect_http']);
|
header('Location: ' . $redirect, true, $config['redirect_http']);
|
||||||
} else {
|
} else {
|
||||||
header('Content-Type: text/json; charset=utf-8');
|
header('Content-Type: text/json; charset=utf-8');
|
||||||
|
$api = new Api();
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'redirect' => $redirect,
|
'redirect' => $redirect,
|
||||||
'noko' => $noko,
|
'noko' => $noko,
|
||||||
'id' => $id
|
'id' => $id,
|
||||||
|
'post' => $api->translatePost(new Post($post))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue