Changeset 3219 for trunk/lib/MT/CMS
- Timestamp:
- 12/03/08 07:58:25 (16 months ago)
- Location:
- trunk/lib/MT/CMS
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/MT/CMS/Blog.pm
r3098 r3219 1008 1008 or return $app->error($app->translate('Can\'t load entry #[_1].', $entry_id)); 1009 1009 $param{build_type_name} = 1010 $app->translate( "[_1] '[_2]'", $entry->class_label, $entry->title);1010 $app->translate( "[_1] '[_2]'", $entry->class_label, MT::Util::encode_html($entry->title) ); 1011 1011 $param{is_entry} = 1; 1012 1012 $param{entry_id} = $entry_id; -
trunk/lib/MT/CMS/Dashboard.pm
r3082 r3219 2 2 3 3 use strict; 4 use MT::Util qw( epoch2ts );4 use MT::Util qw( epoch2ts encode_html ); 5 5 6 6 sub dashboard { … … 137 137 $param->{last_post_id} = $last_post->id; 138 138 $param->{last_post_blog_id} = $last_post->blog_id; 139 $param->{last_post_blog_name} = $last_post->blog->name;139 $param->{last_post_blog_name} = encode_html($last_post->blog->name); 140 140 $param->{last_post_ts} = $last_post->authored_on; 141 141 } -
trunk/lib/MT/CMS/Entry.pm
r3098 r3219 189 189 my $cats = $q->param('category_ids'); 190 190 if ( defined $cats ) { 191 if ( my @cats = split /,/, $cats ) {191 if ( my @cats = grep { $_ =~ /^\d+/ } split /,/, $cats ) { 192 192 $cat_id = $cats[0]; 193 193 %places = map { $_ => 1 } @cats; … … 1930 1930 my $script = 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&title='+encodeURIComponent(d.title)+'&text='+encodeURIComponent(d.location.href)+encodeURIComponent('<br/><br/>')+encodeURIComponent(t),'_blank','scrollbars=yes,status=yes,resizable=yes,location=yes'))!; 1931 1931 # Translate the phrase here to avoid ActivePerl DLL bug. 1932 $app->translate('<a href="[_1]">QuickPost to [_2]</a> - Drag this link to your browser\'s toolbar then click it when you are on a site you want to blog about.', encode_html($script), $blog->name);1932 $app->translate('<a href="[_1]">QuickPost to [_2]</a> - Drag this link to your browser\'s toolbar then click it when you are on a site you want to blog about.', encode_html($script), encode_html($blog->name)); 1933 1933 } 1934 1934 -
trunk/lib/MT/CMS/Search.pm
r2890 r3219 394 394 my %param = %$list_pref; 395 395 my $limit = $q->param('limit') || 125; # FIXME: mt.cfg setting? 396 $limit =~ s/\D//g; 396 397 my $matches; 397 398 $date_col = $api->{date_column} || 'created_on'; -
trunk/lib/MT/CMS/Tools.pm
r3098 r3219 622 622 my @tsnow = gmtime(time); 623 623 my $metadata = { 624 backup_by => $app->user->name. '(ID: ' . $app->user->id . ')',624 backup_by => MT::Util::encode_xml($app->user->name, 1) . '(ID: ' . $app->user->id . ')', 625 625 backup_on => sprintf( 626 626 "%04d-%02d-%02dT%02d:%02d:%02d", -
trunk/lib/MT/CMS/User.pm
r3039 r3219 1566 1566 return $eh->error( $app->translate("User requires username") ) 1567 1567 if ( !$name ); 1568 1569 if ( $name =~ m/([<>])/) { 1570 return $eh->error( $app->translate("[_1] contains an invalid character: [_2]", $app->translate("Username"), encode_html( $1 ) ) ); 1571 } 1568 1572 } 1569 1573 … … 1576 1580 return $eh->error( $app->translate("User requires display name") ) 1577 1581 if ( !length( $nickname ) ); 1582 1583 if ( $nickname =~ m/([<>])/) { 1584 return $eh->error( $app->translate("[_1] contains an invalid character: [_2]", $app->translate("Display Name"), encode_html( $1 ) ) ); 1585 } 1578 1586 } 1579 1587 … … 1614 1622 if ( !$app->param('hint') ); 1615 1623 } 1624 my $email = $app->param('email'); 1616 1625 return $eh->error( 1617 1626 MT->translate("Email Address is required for password recovery") ) 1618 unless $app->param('email'); 1627 unless $email; 1628 if ( $email =~ m/([<>])/) { 1629 return $eh->error( $app->translate("[_1] contains an invalid character: [_2]", $app->translate("Email Address"), encode_html( $1 ) ) ); 1630 } 1631 1619 1632 if ( $app->param('url') ) { 1620 1633 my $url = $app->param('url'); 1621 return $eh->error( MT->translate(" Website URL is invalid") )1622 unless is_url($url);1634 return $eh->error( MT->translate("URL is invalid.") ) 1635 if !is_url($url) || ($url =~ m/[<>]/); 1623 1636 } 1624 1637 1;
