Эх сурвалжийг харах

Fix #189: sitemaps and rss were broken

George S. Baugh 4 жил өмнө
parent
commit
6f255deac6

+ 4 - 2
lib/Trog/Routes/HTML.pm

@@ -1075,11 +1075,13 @@ sub sitemap ($query, $render_cb) {
                         title => substr($url->{title},0,100),
                     }] if $url->{is_image};
 
+	            # Truncate descriptions
+		    my $desc = substr($url->{data},0,2048);
                     $data{videos} = [{
                         content_loc   => "http://$query->{domain}$url->{href}",
                         thumbnail_loc => "http://$query->{domain}$url->{preview}",
                         title         => substr($url->{title},0,100),
-                        description   => $url->{data},
+                        description   => $desc,
                     }] if $url->{is_video};
                 }
 
@@ -1147,7 +1149,7 @@ sub _rss ($query,$posts) {
     );
 
     foreach my $post (@$posts) {
-        my $url = "http://$query->{domain}$query->{local_href}";
+        my $url = "http://$query->{domain}$post->{local_href}";
         _post2rss($rss,$url,$post);
         next unless ref $post->{aliases} eq 'ARRAY';
         foreach my $alias (@{$post->{aliases}}) {