new_posts_ajax_stuff #1
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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'
|
||||
|
|
5
post.php
5
post.php
|
@ -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))
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue