From eee2cf82d48a43ce3201b7154e6939a09f7441be Mon Sep 17 00:00:00 2001 From: TheHowl Date: Wed, 24 Sep 2014 22:35:59 +0200 Subject: [PATCH 1/2] Make ayah optional --- create.php | 16 ++++++++++------ inc/config.php | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/create.php b/create.php index f01a97cb..6a91ba00 100644 --- a/create.php +++ b/create.php @@ -1,15 +1,17 @@ getPublisherHTML(); +$publisher_html = ($config["use_ayah"] ? "Game" . $ayah->getPublisherHTML() . "" : ""); $password = base64_encode(openssl_random_pseudo_bytes(9)); $body = <<Subtitle (must be < 200 chars) Username (must contain only alphanumeric, periods and underscores) Password (write this down) -Game{$publisher_html} +{$publisher_html}
@@ -38,7 +40,9 @@ $title = $_POST['title']; $subtitle = $_POST['subtitle']; $username = $_POST['username']; $password = $_POST['password']; -$score = $ayah->scoreResult(); +if ($config["use_ayah"]) { + $score = $ayah->scoreResult(); +} if (!preg_match('/^[a-z0-9]{1,10}$/', $uri)) error('Invalid URI'); @@ -48,7 +52,7 @@ if (!(strlen($subtitle) < 200)) error('Invalid subtitle'); if (!preg_match('/^[a-zA-Z0-9._]{1,30}$/', $username)) error('Invalid username'); -if (!$score) +if ($config["use_ayah"] && !$score) error('You failed the game'); foreach (listBoards() as $i => $board) { if ($board['uri'] == $uri) diff --git a/inc/config.php b/inc/config.php index e5216470..855a0be1 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1616,3 +1616,7 @@ ''. ''. ''; + + // Set to true to use ayah. Requires to set inc/lib/ayah/ayah_config.php! + // Ayah is highly reccommended (it's also used only for creating boards) + $config["use_ayah"] = false; \ No newline at end of file From e092f5ad38b4f037e7c09b9600d01c9bf1ed0fe8 Mon Sep 17 00:00:00 2001 From: TheHowl Date: Wed, 24 Sep 2014 23:07:36 +0200 Subject: [PATCH 2/2] oh hey look I just fixed #8 search.php It was just a typo, an horrible typo. --- search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.php b/search.php index 394aa3ff..71f4ae5e 100644 --- a/search.php +++ b/search.php @@ -15,7 +15,7 @@ $boards = listBoards(TRUE); } - $body = Element('search_form.html', Array('boards' => $boards, 'board' => isset($_GET['board']) ? $_GET['board'] : false, 'search' => isset($_GET['search']) ? str_replace('"', '"', utf8tohtml($_GET['search'])) : false)); + $body = Element('search_form.html', Array('boards' => $boards, 'b' => isset($_GET['board']) ? $_GET['board'] : false, 'search' => isset($_GET['search']) ? str_replace('"', '"', utf8tohtml($_GET['search'])) : false)); if(isset($_GET['search']) && !empty($_GET['search']) && isset($_GET['board']) && in_array($_GET['board'], $boards)) { $phrase = $_GET['search'];