From 15f804bcff8b7c9ef4211cd160eea8a37eb1cd51 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Wed, 18 May 2011 16:00:33 +1000 Subject: [PATCH] Fixed bug in auto-detecting $config[root] --- inc/config.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/inc/config.php b/inc/config.php index 85335e5a..36ec32d6 100644 --- a/inc/config.php +++ b/inc/config.php @@ -140,6 +140,7 @@ $config['error']['fileexists'] = 'That file already exists!'; $config['error']['delete_too_soon'] = 'You\'ll have to wait another %s before deleting that.'; $config['error']['mime_exploit'] = 'MIME type detection XSS exploit (IE) detected; post discarded.'; + $config['error']['invalid_embed'] = 'Couldn\'t make sense of the URL of the video you tried to embed.'; // Moderator errors $config['error']['invalid'] = 'Invalid username and/or password.'; @@ -216,7 +217,7 @@ // The root directory, including the trailing slash, for Tinyboard. // examples: '/', 'http://boards.chan.org/', '/chan/' - $config['root'] = ($_SERVER['REQUEST_URI'] == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/'); + $config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/'); $config['dir']['img'] = 'src/'; $config['dir']['thumb'] = 'thumb/'; @@ -582,6 +583,18 @@ // Characters used to generate a random password (with Javascript) $config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+'; + // Custom embedding (YouTube, vimeo, etc.) + $config['embedding'] = Array( + Array( + '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9-]{10,11})(&|$)/i', + '' + ) + ); + // Embedding width and height + $config['embed_width'] = 200; + $config['embed_height'] = 164; + + // Enable IP range bans (eg. "127.*.0.1", "127.0.0.*", and "12*.0.0.1" all match "127.0.0.1"). // A little more load on the database $config['ban_range'] = true;