Convert $post to an object before passing it to event(). This way it can be modified by event handlers before entering the database. See http://tinyboard.org/docs/events.html#examples
This commit is contained in:
parent
29dc55c4e8
commit
4c6faeb7a2
@ -6,6 +6,7 @@ function event() {
|
|||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
|
|
||||||
$event = $args[0];
|
$event = $args[0];
|
||||||
|
|
||||||
$args = array_splice($args, 1);
|
$args = array_splice($args, 1);
|
||||||
|
|
||||||
if(!isset($events[$event]))
|
if(!isset($events[$event]))
|
||||||
|
4
post.php
4
post.php
@ -595,10 +595,12 @@
|
|||||||
$post['thumb'] = substr_replace($post['thumb'], '', 0, mb_strlen($board['dir'] . $config['dir']['thumb']));
|
$post['thumb'] = substr_replace($post['thumb'], '', 0, mb_strlen($board['dir'] . $config['dir']['thumb']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$post = (object)$post;
|
||||||
if($error = event('post', $post)) {
|
if($error = event('post', $post)) {
|
||||||
undoImage($post);
|
undoImage((array)$post);
|
||||||
error($error);
|
error($error);
|
||||||
}
|
}
|
||||||
|
$post = (array)$post;
|
||||||
|
|
||||||
$id = post($post, $OP);
|
$id = post($post, $OP);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user