--- lib/MT/Util.pm.orig 2008-03-11 16:14:38.000000000 -0500 +++ lib/MT/Util.pm 2008-03-11 16:35:49.000000000 -0500 @@ -461,7 +461,17 @@ $html =~ s!>!>!g; } #Encode::_utf8_off($html) if MT->instance->charset eq 'utf-8'; - $html; + return strip_chars($html); + } + + sub strip_chars { + my ($string) = @_; + if (MT->instance->charset eq 'utf-8') { + $string =~ s/[^\x09\x0A\x0D\x20-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]/\x{FFFD}/g; + } else { + $string =~ s/[\x00-\x08\x0B\x0C\x0E\x0F\x10-\x1F\x80-\x9F]//g; + } + return $string; } sub decode_html { --- lib/MT/Sanitize.pm.orig 2007-01-05 18:29:17.000000000 -0600 +++ lib/MT/Sanitize.pm 2007-04-17 02:26:58.000000000 -0500 @@ -22,7 +22,7 @@ my(%ok_tags, %tag_attr); for my $rule (split /\s*,\s*/, $a) { my(%ok_attr, $tag, $style); - $tag = lc $rule; + $tag = $rule; if ($tag =~ m|^([^\s]+)\s+(.+)$|) { ($tag, my($attrs)) = ($1, $2); $style = $1 if $tag =~ s|(/)$||; @@ -84,10 +84,10 @@ my $name; my $closure = 0; if ($inside =~ m/^([^ ]+) (.+)$/s) { - $name = lc($1); + $name = $1; $inside = $2; } else { - $name = lc($inside); + $name = $inside; $inside = ''; } if ($name =~ m|^/|) { @@ -102,8 +102,8 @@ (exists $tag_attr->{$name} && $tag_attr->{$name} eq '/')) { if ($inside) { my @attrs; - while ($inside =~ m/([:\w]+)\s*=\s*(['"])(.*?)\2/gs) { - my ($attr, $q, $val) = (lc($1), $2, $3); + while ($inside =~ m/([\-:\w]+)\s*=\s*(['"])(.*?)\2/gs) { + my ($attr, $q, $val) = ($1, $2, $3); if ($ok_tags->{'*'}{$attr} || (ref $ok_tags->{$name} && $ok_tags->{$name}{$attr})) { my $dec_val = decode_html($val); @@ -114,7 +114,7 @@ if ((my $prot) = $dec_val =~ m/^(.+?):/) { next if $prot =~ m/[\r\n\t]/; $prot =~ s/\s+//gs; - next if $prot =~ m/[^a-zA-Z0-9\+]/; + next if $prot =~ m/[^a-zA-Z0-9\+#]/; next if $prot =~ m/script$/i; next if $prot =~ m/&#/; } --- lib/MT/Blog.pm.orig 2006-07-17 23:39:38.000000000 -0500 +++ lib/MT/Blog.pm 2006-07-17 23:44:53.000000000 -0500 @@ -55,7 +55,7 @@ 'ping_technorati' => 'boolean', 'ping_others' => 'text', 'autodiscover_links' => 'boolean', - 'sanitize_spec' => 'string(255)', + 'sanitize_spec' => 'text', 'cc_license' => 'string(255)', 'is_dynamic' => 'boolean', 'remote_auth_token' => 'string(50)', --- lib/MT/App.pm.orig 2007-01-23 17:52:24.000000000 -0600 +++ lib/MT/App.pm 2008-03-11 18:36:28.000000000 -0500 @@ -101,6 +101,9 @@ sub send_http_header { my $app = shift; my($type) = @_; + if ($ENV{'HTTP_CONTENT_TYPE'} && $ENV{'HTTP_CONTENT_TYPE'} ne '' ){ + $type= $ENV{'HTTP_CONTENT_TYPE'}; + } $type ||= 'text/html'; if (my $charset = $app->charset) { $type .= "; charset=$charset" @@ -581,9 +584,9 @@ if ($MT::DebugMode && $@) { $error = '
'.encode_html($error).'
'; } else { - $error = encode_html($error); + $error = encode_html($error,1); } - $error =~ s!(http://\S+)!$1!g; + $error =~ s!(http://\S+)!$1!g; $tmpl = $app->load_tmpl('error.tmpl') or return "Can't load error template; got error '" . $app->errstr . "'. Giving up. Original error was
$error
"; --- tmpl/email/new-comment.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/email/new-comment.tmpl 2006-07-03 08:17:18.000000000 -0500 @@ -9,6 +9,7 @@ : : : + --- lib/MT/Comment.pm.orig 2006-06-16 04:09:55.000000000 -0500 +++ lib/MT/Comment.pm 2006-06-25 00:39:09.000000000 -0500 @@ -21,6 +21,9 @@ 'email' => 'string(75)', 'url' => 'string(255)', 'text' => 'text', + 'subject' => 'text', + 'parent_id' => 'integer not null', + 'convert_breaks' => 'string(30)', 'ip' => 'string(16)', 'last_moved_on' => 'datetime not null', 'junk_score' => 'float', @@ -31,6 +34,7 @@ created_on => 1, entry_id => 1, blog_id => 1, + parent_id => 1, email => 1, commenter_id => 1, visible => 1, --- lib/MT/App/Search.pm.orig 2007-01-23 17:52:24.000000000 -0600 +++ lib/MT/App/Search.pm 2008-03-12 10:19:16.000000000 -0500 @@ -165,6 +165,12 @@ my $file = File::Spec->catfile($app->config('TempDir'), 'mt-throttle.db'); my $DB = tie my %db, 'DB_File', $file; if ($DB) { + #throttle total number of searches + my $max_searches = 5; + if (scalar(keys %db) > $max_searches ) { + return $app->error($app->translate( + "Too many searches are ongoing. Please try yours again later.")); + } if (my $time = $db{$ip}) { if ($time > time - $app->config('ThrottleSeconds')) { return 0; @@ -187,7 +193,7 @@ 'mt-throttle.db'); if (tie my %db, 'DB_File', $file) { my $time = $db{$app->remote_ip}; - delete $db{$app->remote_ip} if ($time && $time < (time - $app->config('ThrottleSeconds'))); + delete $db{$app->remote_ip}; untie %db; } } @@ -450,7 +456,7 @@ require MT::Log; $app->log({ - message => $app->translate("Search: query for '[_1]'", + message => $app->translate(encode_html("Search: query for '[_1]'",1), $app->{search_string}), level => MT::Log::INFO(), class => 'search', --- lib/MT/TBPing.pm.orig 2006-06-27 15:58:14.000000000 -0500 +++ lib/MT/TBPing.pm 2006-07-03 08:22:44.000000000 -0500 @@ -23,6 +23,7 @@ 'source_url' => 'string(255)', 'ip' => 'string(15) not null', 'blog_name' => 'string(255)', + 'tb_charset' => 'string(255)', 'visible' => 'boolean', 'junk_status' => 'smallint not null', 'last_moved_on' => 'datetime not null', --- lib/MT/App/Trackback.pm.orig 2007-01-23 17:52:24.000000000 -0600 +++ lib/MT/App/Trackback.pm 2007-04-18 02:03:46.000000000 -0500 @@ -129,7 +129,7 @@ return 0; } - @ts = offset_time_list(time - $app->config('ThrottleSeconds')*4000 - 1, + @ts = offset_time_list(time - 86400, $tb->blog_id); $from = sprintf("%04d%02d%02d%02d%02d%02d", $ts[5]+1900, $ts[4]+1, @ts[3,2,1,0]); @@ -209,10 +209,10 @@ } } - no_utf8($tb_id, $title, $excerpt, $url, $blog_name); + #no_utf8($tb_id, $title, $excerpt, $url, $blog_name); # guess encoding as possible - $enc = MT::I18N::guess_encoding($excerpt.$title.$blog_name) unless $enc; - ($title, $excerpt, $blog_name) = map { encode_text($_, $enc) } ($title, $excerpt, $blog_name); +# $enc = MT::I18N::guess_encoding($excerpt.$title.$blog_name) unless $enc; +# ($title, $excerpt, $blog_name) = map { encode_text($_, $enc) } ($title, $excerpt, $blog_name); return $app->_response(Error=> $app->translate("Need a Source URL (url).")) unless $url; @@ -261,6 +261,9 @@ $ping->tb_id($tb_id); $ping->source_url($url); $ping->ip($app->remote_ip || ''); + if ($ENV{'CONTENT_TYPE'} =~ /[Cc]harset=([a-zA-Z0-9-]+)/) { + $ping->tb_charset($1); + } $ping->junk_status(0); $ping->visible(1); } @@ -285,6 +288,29 @@ $ping->column($field, $val); } } + ## BEGIN HACK Avoid Duplicate Trackback Pings + ## http://www.nonplus.net/software/mt/AvoidingDuplicateTrackbackPings.htm + my $duplicate_ping = 0; + if(my @existing_pings = MT::TBPing->load({ + blog_id => $ping->blog_id, + tb_id => $ping->tb_id })) { + foreach my $p (@existing_pings) { + next unless ($p->source_url eq $ping->source_url && $p->ip eq $ping->ip); + # If everything is the same, simply return + return $app->_response if ( ($p->title eq $ping->title) + && ($p->blog_name eq $ping->blog_name) + && ($p->excerpt eq $ping->excerpt)); + # If something is different, copy new values to old ping + $p->title($ping->title); + $p->blog_name($ping->blog_name); + $p->excerpt($ping->excerpt); + # and replace new ping with old ping + $ping = $p; + $duplicate_ping = 1; + last; + } + } + ## END HACK Avoid Duplicate Trackback Pings if (!MT->run_callbacks('TBPingFilter', $app, $ping)) { return $app->_response(Error => "", Code => 403); @@ -353,7 +379,7 @@ $app->translate("Can't create RSS feed '[_1]': ", $feed, $fmgr->errstr)); } - $app->_send_ping_notification($blog, $entry, $cat, $ping); + $app->_send_ping_notification($blog, $entry, $cat, $ping) unless $duplicate_ping ; }); } } else { @@ -435,11 +461,12 @@ sub rss { my $app = shift; my($tb_id, $pass) = $app->_get_params; - my $tb = MT::Trackback->load($tb_id) - or return $app->_response(Error => - $app->translate("Invalid TrackBack ID '[_1]'", $tb_id)); - my $rss = _generate_rss($tb); - $app->_response(RSS => $rss); +# my $tb = MT::Trackback->load($tb_id) or + return $app->_response(Error => + $app->translate("RSS disabled because of Trackback Spam")); +# $app->translate("Invalid TrackBack ID '[_1]'", $tb_id)); +# my $rss = _generate_rss($tb); +# $app->_response(RSS => $rss); } sub _generate_rss { --- lib/MT/App/Comments.pm.orig 2006-08-03 16:15:31.000000000 -0500 +++ lib/MT/App/Comments.pm 2006-09-04 01:49:27.000000000 -0500 @@ -114,9 +114,11 @@ unless ($comment->visible); my $uri = encode_html($comment->url); return < -Redirecting... - + + + +Redirecting... + @@ -264,6 +266,33 @@ if ($text eq '') { return $app->handle_error($app->translate("Comment text is required.")); } + require Digest::SHA1; + my $sha1 = Digest::SHA1->new; + + $sha1->add($q->param('text') . $q->param('entry_id') . $app->remote_ip + . $q->param('author') . $q->param('email') . $q->param('url') + . $q->param('subject') . $q->param('convert_breaks')); + my $salt_file = MT::ConfigMgr->instance->PluginPath .'/salt.txt'; + my $FH; + open($FH, $salt_file) or die "cannot open file <$salt_file> ($!)"; + $sha1->addfile($FH); + close $FH; + + my $digest = $sha1->b64digest . "="; + + if (!$q->param('validated') ) { + my $ban = MT::IPBanList->new; + $ban->blog_id($entry->blog_id); + $ban->ip($app->remote_ip); + $ban->save + or die $ban->errstr; + return $app->handle_error($app->translate("You are not allowed to post comments.")); + } + + if ($q->param('validated') ne $digest) { + return $app->handle_error($app->translate( + "Please preview your modified entry before posting it.")); + } my ($comment, $commenter) = _make_comment($app, $entry); my $remember = $q->param('bakecookie') || 0; @@ -509,6 +538,7 @@ $email = $commenter->email(); } my $url = $q->param('url') || ''; #($commenter ? $commenter->url() : ''); + my $subject = $q->param('subject') ? $q->param('subject') : ' '; my $comment = MT::Comment->new; if ($commenter) { $comment->commenter_id($commenter->id); @@ -516,7 +546,7 @@ ## Strip linefeed characters. my $text = $q->param('text'); $text = '' unless defined $text; - $text =~ tr/\r//d; +# $text =~ tr/\r//d; $comment->ip($app->remote_ip); $comment->blog_id($entry->blog_id); $comment->entry_id($entry->id); @@ -524,6 +554,9 @@ $comment->email(remove_html($email)); $comment->url(is_valid_url($url, 'stringent')); $comment->text($text); + $comment->subject($subject); + $comment->parent_id($q->param('parent_id')); + $comment->convert_breaks($q->param('convert_breaks')); #$comment->visible(0); # leave as undefined $comment->is_junk(0); @@ -608,6 +641,7 @@ (comment_email => $comment->email):()), comment_url => $comment->url, comment_text => wrap_text($comment->text, 72), + comment_subject => $comment->subject, unapproved => !$comment->visible(), ); my $body = MT->build_email('new-comment.tmpl', \%param); @@ -1015,6 +1049,8 @@ $ctx->stash('entry', $entry); $ctx->stash('commenter', $cmntr) if ($cmntr); $ctx->{current_timestamp} = $entry->created_on; + $ctx->stash('comment_parent_id', $q->param('parent_id')); + $ctx->stash('convert_breaks', $q->param('convert_breaks')); my %cond; my $tmpl = ($q->param('arch')) ? (MT::Template->load({ type => 'individual', --- lib/MT/Template/ContextHandlers.pm.orig 2006-07-06 12:11:02.000000000 -0500 +++ lib/MT/Template/ContextHandlers.pm 2006-08-17 21:34:47.000000000 -0500 @@ -22,6 +22,8 @@ use MT::Entry; use MT::I18N qw( first_n_text const ); +my $publish_charset = _hdlr_publish_charset(); + sub init_default_handlers { %MT::Template::Context::Handlers = ( Else => [ \&_hdlr_pass_tokens, 1 ], @@ -2553,11 +2555,14 @@ unless ($blog->allow_comment_html) { $t = remove_html($t); } + my $filter = defined $c->convert_breaks ? + [$c->convert_breaks] : + $blog->comment_text_filters; my $convert_breaks = exists $arg->{convert_breaks} ? $arg->{convert_breaks} : $blog->convert_paras_comments; $t = $convert_breaks ? - MT->apply_text_filters($t, $blog->comment_text_filters, $ctx) : + MT->apply_text_filters($t, $filter, $ctx) : $t; if (!(exists $arg->{autolink} && !$arg->{autolink}) && $blog->autolink_urls) { @@ -3594,7 +3599,8 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingTitle'); - defined $ping->title ? $ping->title : ''; + my $title = defined $ping->title ? $ping->title : ''; + return _transcode_text($ping->tb_charset, $title); } sub _hdlr_ping_url { sanitize_on($_[1]); @@ -3606,7 +3612,8 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingExcerpt'); - defined $ping->excerpt ? $ping->excerpt : ''; + my $excerpt = defined $ping->excerpt ? $ping->excerpt : ''; + return _transcode_text($ping->tb_charset, $excerpt); } sub _hdlr_ping_ip { my $ping = $_[0]->stash('ping') @@ -3617,7 +3624,21 @@ sanitize_on($_[1]); my $ping = $_[0]->stash('ping') or return $_[0]->_no_ping_error('MTPingBlogName'); - defined $ping->blog_name ? $ping->blog_name : ''; + my $blog_name = defined $ping->blog_name ? $ping->blog_name : ''; + return _transcode_text($ping->tb_charset, $blog_name); +} + +sub _transcode_text { + my ($text_charset, $text) = @_; + require Text::Iconv; + use Encode; + if (defined $text_charset && lc($text_charset) ne $publish_charset ) { + $text_charset = lc($text_charset); + $text = Text::Iconv->new($text_charset,'utf-8')->convert($text) unless $text_charset eq 'utf-8'; + $text = encode($publish_charset, decode('utf-8',$text), Encode::FB_XMLCREF) unless $publish_charset eq 'utf-8'; + } + $text =~ s/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/&/g; + return $text; } sub _hdlr_if_allow_comment_html { --- tmpl/cms/header-popup.tmpl.orig 2006-06-13 19:15:36.000000000 -0500 +++ tmpl/cms/header-popup.tmpl 2006-07-03 14:25:06.000000000 -0500 @@ -1,6 +1,6 @@ - + <TMPL_LOOP NAME=PAGE_TITLES><TMPL_VAR NAME=BC_NAME ESCAPE=HTML> | </TMPL_LOOP><TMPL_VAR NAME=MT_PRODUCT_NAME> --- tmpl/cms/header.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/header.tmpl 2006-07-03 14:29:26.000000000 -0500 @@ -1,6 +1,7 @@ - + + - + <TMPL_LOOP NAME=PAGE_TITLES><TMPL_VAR NAME=BC_NAME ESCAPE=HTML> | </TMPL_LOOP><TMPL_VAR NAME=MT_PRODUCT_NAME> --- tmpl/cms/list_comment.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/list_comment.tmpl 2006-07-03 14:34:54.000000000 -0500 @@ -1,7 +1,7 @@
--- tmpl/cms/list_notification.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/list_notification.tmpl 2006-07-03 14:40:50.000000000 -0500 @@ -3,7 +3,7 @@

:

@@ -64,7 +64,7 @@

:   - + " /> " onclick="cancelCreateMode(); return false" />

--- tmpl/cms/list_commenters.tmpl.orig 2006-06-27 14:39:15.000000000 -0500 +++ tmpl/cms/list_commenters.tmpl 2006-07-03 14:47:16.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/edit_categories.tmpl.orig 2006-06-19 17:21:03.000000000 -0500 +++ tmpl/cms/edit_categories.tmpl 2006-07-03 15:04:45.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/reload_opener.tmpl.orig 2005-05-17 16:17:07.000000000 -0500 +++ tmpl/cms/reload_opener.tmpl 2006-07-03 15:11:58.000000000 -0500 @@ -1,14 +1,14 @@ - + --- tmpl/cms/list_ping.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/list_ping.tmpl 2006-07-03 15:32:51.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/edit_placements.tmpl.orig Sat Apr 30 02:50:18 2005 +++ tmpl/cms/edit_placements.tmpl Sat Apr 30 13:49:48 2005 @@ -1,8 +1,7 @@
--- tmpl/cms/cfg_prefs.tmpl.orig 2006-06-26 00:50:04.000000000 -0500 +++ tmpl/cms/cfg_prefs.tmpl 2006-07-03 15:45:44.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/bm_entry.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/bm_entry.tmpl 2006-07-03 16:04:47.000000000 -0500 @@ -1,7 +1,7 @@
@@ -303,20 +303,6 @@
-
--- tmpl/cms/view_log.tmpl.orig 2006-06-25 20:00:43.000000000 -0500 +++ tmpl/cms/view_log.tmpl 2006-07-03 16:09:36.000000000 -0500 @@ -1,7 +1,7 @@

:

--- tmpl/cms/preview_entry.tmpl.orig 2005-05-05 07:35:27.000000000 -0500 +++ tmpl/cms/preview_entry.tmpl 2005-05-05 07:39:45.000000000 -0500 @@ -7,7 +7,7 @@ - + --- tmpl/cms/pinging.tmpl.orig 2005-04-21 23:31:32.000000000 -0500 +++ tmpl/cms/pinging.tmpl 2005-05-23 03:03:18.000000000 -0500 @@ -1,16 +1,13 @@ - - + --- tmpl/cms/rebuilding.tmpl.orig 2006-06-05 18:24:15.000000000 -0500 +++ tmpl/cms/rebuilding.tmpl 2006-07-03 16:22:48.000000000 -0500 @@ -1,11 +1,9 @@ - - - - + + --- tmpl/cms/list_entry.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/list_entry.tmpl 2006-07-03 16:27:53.000000000 -0500 @@ -1,13 +1,11 @@ - - - - + +

:

--- lib/MT/App/CMS.pm.orig 2007-01-23 17:52:24.000000000 -0600 +++ lib/MT/App/CMS.pm 2007-05-01 23:56:43.000000000 -0500 @@ -1503,7 +1503,7 @@ my($show, $height) = @_; my %args = (is_bm => 1, bm_show => $show, '_type' => 'entry'); my $uri = $app->base . $app->uri('mode' => 'view', args => \%args); - qq!javascript:d=document;w=window;t='';if(d.selection)t=d.selection.createRange().text;else{if(d.getSelection)t=d.getSelection();else{if(w.getSelection)t=w.getSelection()}}void(w.open('$uri&link_title='+escape(d.title)+'&link_href='+escape(d.location.href)+'&text='+escape(t),'_blank','scrollbars=yes,width=400,height=$height,status=yes,resizable=yes'))!; + qq!javascript:d=document;w=window;t='';if(d.selection)t=d.selection.createRange().text;else{if(d.getSelection)t=d.getSelection();else{if(w.getSelection)t=w.getSelection()}}void(w.open('$uri&link_title='+escape(d.title)+'&link_href='+escape(d.location.href)+'&text='+escape(t),'_blank','scrollbars=yes,width=400,height=$height,status=yes,resizable=yes'))!; } sub apply_log_filter { @@ -7509,12 +7509,39 @@ $entry->convert_breaks(scalar $q->param('convert_breaks')); my $ctx = MT::Template::Context->new; $ctx->stash('entry', $entry); + $ctx->stash('blog_id', $blog_id); $ctx->stash('blog', $blog); my $build = MT::Builder->new; my $preview_code = <<'HTML'; -

<$MTEntryTitle$>

-<$MTEntryBody$> -<$MTEntryMore$> + +<$MTInclude module="DTD"$> + + +Your Comment + + +

<$MTEntryTitle smarty_pants="2"$>

+
+ +<$MTEntryBody smarty_pants="2" process_tags="1"$> +
+<$MTEntryMore smarty_pants="2" process_tags="1"$> +
+
+ + +
+ + +

<$MTEntryTitle smarty_pants="2"$>

+
+ +<$MTEntryBody smarty_pants="2"$> +
+<$MTEntryMore smarty_pants="2"$> +
+
+
HTML my $tokens = $build->compile($ctx, $preview_code) or return $app->error($app->translate( --- tmpl/cms/edit_category.tmpl.orig 2006-06-15 19:01:18.000000000 -0500 +++ tmpl/cms/edit_category.tmpl 2006-07-03 16:33:58.000000000 -0500 @@ -3,6 +3,7 @@

: :

--- tmpl/cms/edit_permissions.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/edit_permissions.tmpl 2006-07-03 16:43:36.000000000 -0500 @@ -1,7 +1,7 @@
--- tmpl/cms/edit_author.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/edit_author.tmpl 2006-07-03 16:46:57.000000000 -0500 @@ -1,7 +1,7 @@
--- tmpl/cms/cfg_archives.tmpl.orig 2006-07-03 17:10:06.000000000 -0500 +++ tmpl/cms/cfg_archives.tmpl 2006-07-03 17:11:08.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/cfg_entries_edit_page.tmpl.orig 2006-07-03 17:13:35.000000000 -0500 +++ tmpl/cms/cfg_entries_edit_page.tmpl 2006-07-03 17:14:19.000000000 -0500 @@ -1,5 +1,5 @@
--- tmpl/cms/edit_admin_permissions.tmpl.orig 2006-07-03 17:25:35.000000000 -0500 +++ tmpl/cms/edit_admin_permissions.tmpl 2006-07-03 17:26:21.000000000 -0500 @@ -1,7 +1,7 @@
--- tmpl/cms/edit_blog.tmpl.orig 2006-07-03 17:27:48.000000000 -0500 +++ tmpl/cms/edit_blog.tmpl 2006-07-03 17:28:29.000000000 -0500 @@ -3,7 +3,7 @@

--- tmpl/cms/edit_commenter.tmpl.orig 2006-07-03 17:30:45.000000000 -0500 +++ tmpl/cms/edit_commenter.tmpl 2006-07-03 17:31:18.000000000 -0500 @@ -2,7 +2,7 @@ --- tmpl/cms/entry_prefs.tmpl.orig 2006-07-03 17:36:29.000000000 -0500 +++ tmpl/cms/entry_prefs.tmpl 2006-07-03 17:37:13.000000000 -0500 @@ -3,7 +3,7 @@
--- tmpl/cms/upload.tmpl.orig 2006-07-03 20:59:54.000000000 -0500 +++ tmpl/cms/upload.tmpl 2006-07-03 21:01:16.000000000 -0500 @@ -1,7 +1,7 @@ --- tmpl/cms/upgrade_runner.tmpl.orig 2006-07-03 21:57:58.000000000 -0500 +++ tmpl/cms/upgrade_runner.tmpl 2006-07-03 21:59:39.000000000 -0500 @@ -5,7 +5,7 @@ --- tmpl/cms/import_end.tmpl.orig 2006-07-18 00:30:22.000000000 -0500 +++ tmpl/cms/import_end.tmpl 2006-07-18 00:31:47.000000000 -0500 @@ -2,12 +2,12 @@
--- tmpl/cms/junk_results.tmpl.orig 2006-07-18 00:33:51.000000000 -0500 +++ tmpl/cms/junk_results.tmpl 2006-07-18 00:34:34.000000000 -0500 @@ -1,7 +1,7 @@ --- tmpl/cms/list_author.tmpl.orig 2006-07-18 00:35:38.000000000 -0500 +++ tmpl/cms/list_author.tmpl 2006-07-18 00:36:41.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/list_banlist.tmpl.orig 2006-07-18 00:38:04.000000000 -0500 +++ tmpl/cms/list_banlist.tmpl 2006-07-18 00:38:46.000000000 -0500 @@ -3,7 +3,7 @@

:

--- tmpl/cms/list_plugin.tmpl.orig 2006-07-18 00:40:54.000000000 -0500 +++ tmpl/cms/list_plugin.tmpl 2006-07-18 00:41:42.000000000 -0500 @@ -1,7 +1,7 @@
--- tmpl/cms/list_tags.tmpl.orig 2006-07-18 00:43:10.000000000 -0500 +++ tmpl/cms/list_tags.tmpl 2006-07-18 00:44:07.000000000 -0500 @@ -5,7 +5,7 @@

:

--- mt-static/mt.js.orig 2007-01-23 17:52:24.000000000 -0600 +++ mt-static/mt.js 2008-01-24 15:26:10.000000000 -0600 @@ -763,3 +763,92 @@ //These two lines are to translate phrases in list_tags.tmpl //trans('The tag \'[_2]\' already exists. Are you sure you want to merge \'[_1]\' with \'[_2]\'?'); //trans('The tag \'[_2]\' already exists. Are you sure you want to merge \'[_1]\' with \'[_2]\' across all weblogs?'); + +window.onload = function () { + + var bold_button = document.createElement('a'); + bold_button.setAttribute('title','Bold'); + bold_button.setAttribute('href','#'); + bold_button.setAttribute('onclick','return formatStr(document.entry_form.text, \'strong\')'); + var bold_img = document.createElement('img'); + bold_img.setAttribute('src','/MT-static/3.0/images/html-bold.gif'); + bold_img.setAttribute('alt','Bold'); + bold_img.setAttribute('width','22'); + bold_img.setAttribute('height','16'); + bold_button.appendChild(bold_img); + + var italic_button = document.createElement('a'); + italic_button.setAttribute('title','Italic'); + italic_button.setAttribute('href','#'); + italic_button.setAttribute('onclick','return formatStr(document.entry_form.text, \'em\')'); + var italic_img = document.createElement('img'); + italic_img.setAttribute('src','/MT-static/3.0/images/html-italic.gif'); + italic_img.setAttribute('alt','Italic'); + italic_img.setAttribute('width','22'); + italic_img.setAttribute('height','16'); + italic_button.appendChild(italic_img); + + var underline_button = document.createElement('a'); + underline_button.setAttribute('title','Underline'); + underline_button.setAttribute('href','#'); + underline_button.setAttribute('onclick','return formatStr(document.entry_form.text, \'u\')'); + var underline_img = document.createElement('img'); + underline_img.setAttribute('src','/MT-static/3.0/images/html-underline.gif'); + underline_img.setAttribute('alt','Underline'); + underline_img.setAttribute('width','22'); + underline_img.setAttribute('height','16'); + underline_button.appendChild(underline_img); + + link_button = document.createElement('a'); + link_button.setAttribute('title','Insert Link'); + link_button.setAttribute('href','#'); + link_button.setAttribute('onclick','return insertLink(document.entry_form.text)'); + link_img = document.createElement('img'); + link_img.setAttribute('src','/MT-static/3.0/images/html-link.gif'); + link_img.setAttribute('alt','Insert Link'); + link_img.setAttribute('width','22'); + link_img.setAttribute('height','16'); + link_button.appendChild(link_img); + + var email_button = document.createElement('a'); + email_button.setAttribute('title','Insert Email Link'); + email_button.setAttribute('href','#'); + email_button.setAttribute('onclick','return insertLink(document.entry_form.text, 1)'); + var email_img = document.createElement('img'); + email_img.setAttribute('src','/MT-static/3.0/images/html-email.gif'); + email_img.setAttribute('alt','Insert Email Link'); + email_img.setAttribute('width','22'); + email_img.setAttribute('height','16'); + email_button.appendChild(email_img); + + var quote_button = document.createElement('a'); + quote_button.setAttribute('title','Quote'); + quote_button.setAttribute('href','#'); + quote_button.setAttribute('onclick','return formatStr(document.entry_form.text, \'blockquote\')'); + var quote_img = document.createElement('img'); + quote_img.setAttribute('src','/MT-static/3.0/images/html-quote.gif'); + quote_img.setAttribute('alt','Quote'); + quote_img.setAttribute('width','22'); + quote_img.setAttribute('height','16'); + quote_button.appendChild(quote_img); + + var div, divs = document.getElementsByTagName('div'); + for (i=0; i < divs.length; i++ ) { + div = divs[i]; + if ( div.getAttribute('class') == 'field-buttons' ) { + div.appendChild(bold_button.cloneNode(true)); + div.appendChild(italic_button.cloneNode(true)); + div.appendChild(underline_button.cloneNode(true)); + div.appendChild(link_button.cloneNode(true)); + div.appendChild(email_button.cloneNode(true)); + div.appendChild(quote_button.cloneNode(true)); + bold_button.setAttribute('onclick','return formatStr(document.entry_form.text_more, \'strong\')'); + italic_button.setAttribute('onclick','return formatStr(document.entry_form.text_more, \'em\')'); + underline_button.setAttribute('onclick','return formatStr(document.entry_form.text_more, \'u\')'); + link_button.setAttribute('onclick','return insertLink(document.entry_form.text_more)'); + email_button.setAttribute('onclick','return insertLink(document.entry_form.text_more, 1)'); + quote_button.setAttribute('onclick','return formatStr(document.entry_form.text_more, \'blockquote\')'); + } + } + +} --- tmpl/cms/edit_template.tmpl.orig 2006-06-26 19:31:13.000000000 -0500 +++ tmpl/cms/edit_template.tmpl 2006-07-18 22:55:40.000000000 -0500 @@ -3,7 +3,7 @@

: :

@@ -239,7 +239,7 @@
- +
--- tmpl/cms/list_template.tmpl.orig 2006-06-15 14:10:36.000000000 -0500 +++ tmpl/cms/list_template.tmpl 2006-07-18 23:15:04.000000000 -0500 @@ -1,7 +1,7 @@
style="display: none"> --- tmpl/cms/edit_profile.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/edit_profile.tmpl 2006-07-19 00:03:06.000000000 -0500 @@ -1,7 +1,7 @@
@@ -212,7 +212,7 @@

- "> + " />
--- tmpl/cms/ping_table.tmpl.orig 2006-07-19 00:22:28.000000000 -0500 +++ tmpl/cms/ping_table.tmpl 2006-07-19 00:24:46.000000000 -0500 @@ -79,7 +79,7 @@ : "> » - + "> --- tmpl/cms/system_list_blog.tmpl.orig 2006-07-18 00:47:19.000000000 -0500 +++ tmpl/cms/system_list_blog.tmpl 2006-07-19 00:32:52.000000000 -0500 @@ -1,7 +1,7 @@

:

@@ -88,7 +88,7 @@ - + --- tmpl/cms/entry_table.tmpl.orig 2006-07-19 00:37:14.000000000 -0500 +++ tmpl/cms/entry_table.tmpl 2006-07-19 00:47:07.000000000 -0500 @@ -9,7 +9,7 @@ - + @@ -112,7 +112,7 @@ - + --- tmpl/cms/error.tmpl.orig 2006-07-19 01:25:15.000000000 -0500 +++ tmpl/cms/error.tmpl 2006-07-19 01:25:57.000000000 -0500 @@ -6,7 +6,7 @@
" /> -" /> +" />
--- tmpl/cms/search_replace.tmpl.orig 2006-06-24 20:43:26.000000000 -0500 +++ tmpl/cms/search_replace.tmpl 2006-07-19 09:50:05.000000000 -0500 @@ -1,7 +1,7 @@
@@ -136,21 +136,21 @@

- + - - + + - + - - - + + +
    --- tmpl/cms/edit_entry.tmpl.orig 2006-06-27 20:31:56.000000000 -0500 +++ tmpl/cms/edit_entry.tmpl 2006-07-19 22:11:04.000000000 -0500 @@ -8,7 +8,7 @@ @@ -339,7 +338,7 @@ -
    +
    @@ -530,26 +529,8 @@
    -
    -
    @@ -568,26 +549,8 @@
    -
    -
    --- tmpl/cms/entry_table.tmpl.orig 2006-07-24 21:26:17.000000000 -0500 +++ tmpl/cms/entry_table.tmpl 2006-07-24 21:34:42.000000000 -0500 @@ -90,8 +90,8 @@ - - + +    --- tmpl/cms/log_table.tmpl.orig 2006-07-28 13:01:23.000000000 -0500 +++ tmpl/cms/log_table.tmpl 2006-07-28 13:02:23.000000000 -0500 @@ -49,7 +49,7 @@   -
    +
    --- tmpl/cms/cfg_simple.tmpl.orig 2006-06-24 00:54:07.000000000 -0500 +++ tmpl/cms/cfg_simple.tmpl 2006-08-16 08:02:20.000000000 -0500 @@ -5,7 +5,7 @@

    :

    @@ -311,7 +311,7 @@

    -" onclick="window.open('/handshake?url=&blog_id=');return false"/> +" onclick="window.open('/handshake?url=&blog_id=');return false"/>  

    --- tmpl/cms/cfg_feedback.tmpl.orig 2006-06-05 18:24:15.000000000 -0500 +++ tmpl/cms/cfg_feedback.tmpl 2006-08-16 08:05:15.000000000 -0500 @@ -3,7 +3,7 @@

    :

    @@ -132,7 +132,7 @@

    -" onclick="window.open('/handshake?lang=&url=&blog_id=');return false"/> +" onclick="window.open('/handshake?lang=&url=&blog_id=');return false"/>  

    --- tmpl/cms/menu.tmpl.orig 2006-06-12 00:21:37.000000000 -0500 +++ tmpl/cms/menu.tmpl 2006-08-17 08:08:50.000000000 -0500 @@ -3,7 +3,7 @@
    -"> + | ">
    @@ -179,7 +179,7 @@
    " accesskey="s" title="" /> -', '', 'id', {'return_args' : '__mode=list_comments&blog_id='})" value="" title="" /> +', '', 'id', {'return_args' : '__mode=list_comments&blog_id='})" value="" title="" /> " /> --- tmpl/cms/edit_ping.tmpl.orig 2007-04-18 02:15:43.000000000 -0500 +++ tmpl/cms/edit_ping.tmpl 2007-09-27 16:30:08.000000000 -0500 @@ -23,7 +23,7 @@
    -"> + | ">
    @@ -126,7 +126,7 @@
    " accesskey="s" title="" /> -', '', false, { 'return_args' : '__mode=list_pings&blog_id='})" value="" accesskey="x" title="" /> +', '', false, { 'return_args' : '__mode=list_pings&blog_id='})" value="" accesskey="x" title="" /> " /> --- tmpl/cms/notification_table.tmpl.orig 2008-03-21 11:47:40.000000000 -0500 +++ tmpl/cms/notification_table.tmpl 2008-03-21 11:48:23.000000000 -0500 @@ -26,7 +26,7 @@ - +