'Rules', 'subtitle'=>'', 'config'=>$config, 'body'=>''.purify($_POST['rules']).'
')));
- file_write($b.'/rules.txt', $_POST['rules']);
- openBoard($b);
- buildIndex();
- buildJavascript();
- $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error());
- while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
- buildThread($post['id']);
- }
- modLog('Edited board settings', $b);
- }
-
- $query = prepare('SELECT * FROM boards WHERE uri = :board');
- $query->bindValue(':board', $b);
- $query->execute() or error(db_error($query));
- $board = $query->fetchAll()[0];
-
- $rules = @file_get_contents($board['uri'] . '/rules.txt');
- $css = @file_get_contents('stylesheets/board/' . $board['uri'] . '.css');
-
- openBoard($b);
-
- rebuildThemes('bans');
-
- if ($config['cache']['enabled'])
- cache::delete('board_' . $board['uri']);
- cache::delete('all_boards');
-
- mod_page(_('Board configuration'), 'mod/settings.html', array('board'=>$board, 'rules'=>prettify_textarea($rules), 'css'=>prettify_textarea($css), 'token'=>make_secure_link_token('settings/'.$board['uri']), 'languages'=>$possible_languages));
- };
- $config['embedding'] = array(
- array(
- '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
- ''
- ),
- array(
- '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i',
- ''
- ),
- array(
- '/^https?:\/\/(\w+\.)?dailymotion\.com\/video\/([a-zA-Z0-9]{2,10})(_.+)?$/i',
- ''
- ),
- array(
- '/^https?:\/\/(\w+\.)?metacafe\.com\/watch\/(\d+)\/([a-zA-Z0-9_\-.]+)\/(\?.+)?$/i',
- ''
- ),
- array(
- '/^https?:\/\/video\.google\.com\/videoplay\?docid=(\d+)([](.+)?)?$/i',
- ''
- ),
- array(
- '/^https?:\/\/(\w+\.)?vocaroo\.com\/i\/([a-zA-Z0-9]{2,15})$/i',
- ''
- )
- );
-
-$config['gzip_static'] = false;
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 3cdf1374..52b831aa 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -496,7 +496,7 @@ function mod_new_board() {
error(sprintf($config['error']['boardexists'], $board['url']));
}
- $query = prepare('INSERT INTO ``boards`` VALUES (:uri, :title, :subtitle)');
+ $query = prepare('INSERT INTO ``boards`` (``uri``, ``title``, ``subtitle``) VALUES (:uri, :title, :subtitle)');
$query->bindValue(':uri', $_POST['uri']);
$query->bindValue(':title', $_POST['title']);
$query->bindValue(':subtitle', $_POST['subtitle']);
diff --git a/post.php b/post.php
index 40f71555..0781d128 100644
--- a/post.php
+++ b/post.php
@@ -2,10 +2,13 @@
/*
* Copyright (c) 2010-2014 Tinyboard Development Group
*/
+
+require "./inc/functions.php";
+require "./inc/anti-bot.php";
-require 'inc/functions.php';
-require 'inc/anti-bot.php';
-include "inc/dnsbls.php";
+// The dnsbls is an optional DNS blacklist include.
+// Squelch warnings if it doesn't exist.
+@include "./inc/dnsbls.php";
// Fix for magic quotes
if (get_magic_quotes_gpc()) {
@@ -573,14 +576,16 @@ if (isset($_POST['delete'])) {
}
$md5cmd = $config['bsd_md5'] ? 'md5 -r' : 'md5sum';
-
- if ($output = shell_exec_error("cat $filenames | $md5cmd")) {
+
+ if( ($output = shell_exec_error("cat $filenames | $md5cmd")) !== false ) {
$explodedvar = explode(' ', $output);
$hash = $explodedvar[0];
$post['filehash'] = $hash;
- } elseif ($config['max_images'] === 1) {
+ }
+ elseif ($config['max_images'] === 1) {
$post['filehash'] = md5_file($upload);
- } else {
+ }
+ else {
$str_to_hash = '';
foreach (explode(' ', $filenames) as $i => $f) {
$str_to_hash .= file_get_contents($f);