//$text = transform($text);
 if (Config::ENABLE_WORDFILTER) {
     $words = words_get_all_by_board(boards_check_id($_REQUEST['board']));
     foreach ($words as $_) {
         $text = preg_replace("#" . $_['word'] . "#iu", $_['replace'], $text);
     }
 }
 $text = str_replace('\\', '\\\\', $text);
 if (!posts_check_text($text)) {
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, new NonUnicodeError());
     exit(1);
 }
 posts_prepare_text($text, $board);
 if (posts_check_text_size($text) === FALSE) {
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, kotoba_last_error());
     exit(1);
 }
 // Attachment.
 if ($attachment_type !== NULL) {
     if ($attachment_type == Config::ATTACHMENT_TYPE_FILE || $attachment_type == Config::ATTACHMENT_TYPE_IMAGE) {
         $file_hash = calculate_file_hash($uploaded_file_path);
         $file_exists = false;
         $same_attachments = null;
         switch ($board['same_upload']) {
             case 'once':
                 $same_attachments = attachments_get_same($board['id'], $_SESSION['user'], $file_hash);
                 if (count($same_attachments) > 0) {
Beispiel #2
0
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, new SearchKeywordError());
     exit(1);
 }
 if (!posts_check_text_size($search['keyword'])) {
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, new SearchKeywordError());
     exit(1);
 }
 // Encode quotes, bracers and percent sign into html entities.
 $keyword = htmlentities($search['keyword'], ENT_QUOTES, Config::MB_ENCODING);
 // Strip slashes.
 $keyword = str_replace('\\', '\\\\', $keyword);
 if (!posts_check_text_size($keyword)) {
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, new SearchKeywordError());
     exit(1);
 }
 if (!posts_check_text($text)) {
     // Cleanup
     DataExchange::releaseResources();
     display_error_page($smarty, new NonUnicodeError());
     exit(1);
 }
 // Strip % and _ signs.
 $keyword = addcslashes($keyword, '%_');
 // Choose boards for search.
 $search_boards = array();