From 5899ae9017c351b9987868871605f3f2324c62c0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 8 Feb 2011 21:26:28 -0800 Subject: [PATCH] Support bbcode size tag - I may regret this... --- boot.php | 4 ++-- include/bbcode.php | 4 ++-- include/html2bbcode.php | 2 ++ tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/boot.php b/boot.php index 3edd45971..9d41abec4 100644 --- a/boot.php +++ b/boot.php @@ -305,9 +305,9 @@ class App { $this->scheme = $parsed['scheme']; $this->hostname = $parsed['host']; - if($parsed['port']) + if(x($parsed,'port')) $this->hostname .= ':' . $parsed['port']; - if($parsed['path']) + if(x($parsed,'path')) $this->path = trim($parsed['path'],'\\/'); } diff --git a/include/bbcode.php b/include/bbcode.php index eb0806dc5..f39ebd5b9 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -49,10 +49,10 @@ function bbcode($Text) { $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'$1',$Text); // Check for colored text - $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text); + $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","$2",$Text); // Check for sized text - $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text); + $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","$2",$Text); // Check for list text $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '' ,$Text); diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 6af8df824..bde761f2f 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -26,6 +26,7 @@ function html2bbcode($s) { '/\(.*?)\<\/a\>/is', '/\(.*?)\<\/code\>/is', '/\(.*?)\<\/span\>/is', + '/\(.*?)\<\/span\>/is', '/\(.*?)\<\/blockquote\>/is', '/\(.*?)\<\/video\>/is', '/\(.*?)\<\/audio\>/is', @@ -51,6 +52,7 @@ function html2bbcode($s) { '[url=$2]$4[/url]', '[code]$1[/code]', '[color="$1"]$2[/color]', + '[size=$1]$2[/size]', '[quote]$1[/quote]', '[video]$1[/video]', '[audio]$1[/audio]', diff --git a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js index ebccfb311..aad83280d 100644 --- a/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ b/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js @@ -103,7 +103,7 @@ rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,""); rep(/\[img\](.*?)\[\/img\]/gi,""); rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); -// rep(/\[\/code\]\s*\[code\]/gi,"
"); // fold multiline code + rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"$2"); rep(/\[code\](.*?)\[\/code\]/gi,"$1"); rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"
$1
");