summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-07-16 13:02:13 -0400
committerczaks <marcin@6irc.net>2013-07-16 13:02:13 -0400
commit7bdb96a16b51eb8086fead11783bb095ea42cd90 (patch)
treeb236bbd6082d927e25ecf4b07ea45bb5e1206a60 /mod.php
parent8a598982a4f6ae48ad6e2a4d634314215871c4c1 (diff)
parentaadb57f2a2db9210468f25d7dcd45d561ef6ad54 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: install.php templates/index.html templates/thread.html
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/mod.php b/mod.php
index 8d6db402..e76f1f01 100644
--- a/mod.php
+++ b/mod.php
@@ -103,7 +103,7 @@ if (isset($config['mod']['custom_pages'])) {
$new_pages = array();
foreach ($pages as $key => $callback) {
- if (preg_match('/^secure /', $callback))
+ if (is_string($callback) && preg_match('/^secure /', $callback))
$key .= '(/(?P<token>[a-f0-9]{8}))?';
$new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!'] = $callback;
}
@@ -113,7 +113,7 @@ foreach ($pages as $uri => $handler) {
if (preg_match($uri, $query, $matches)) {
$matches = array_slice($matches, 1);
- if (preg_match('/^secure(_POST)? /', $handler, $m)) {
+ if (is_string($handler) && preg_match('/^secure(_POST)? /', $handler, $m)) {
$secure_post_only = isset($m[1]);
if (!$secure_post_only || $_SERVER['REQUEST_METHOD'] == 'POST') {
$token = isset($matches['token']) ? $matches['token'] : (isset($_POST['token']) ? $_POST['token'] : false);