Commit 6de0f9b65e276c1bbb10d339f7808315cb179af4
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'master' into stable
Showing
4 changed files
with
19 additions
and
15 deletions
Show diff stats
app/helpers/application_helper.rb
| ... | ... | @@ -907,13 +907,15 @@ module ApplicationHelper |
| 907 | 907 | end |
| 908 | 908 | |
| 909 | 909 | def page_title |
| 910 | - (@page ? @page.title + ' - ' : '') + | |
| 911 | - (@topic ? @topic.title + ' - ' : '') + | |
| 912 | - (@section ? @section.title + ' - ' : '') + | |
| 913 | - (@toc ? _('Online Manual') + ' - ' : '') + | |
| 914 | - (controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') + | |
| 915 | - (profile ? profile.short_name : environment.name) + | |
| 916 | - (@category ? " - #{@category.full_name}" : '') | |
| 910 | + CGI.escapeHTML( | |
| 911 | + (@page ? @page.title + ' - ' : '') + | |
| 912 | + (@topic ? @topic.title + ' - ' : '') + | |
| 913 | + (@section ? @section.title + ' - ' : '') + | |
| 914 | + (@toc ? _('Online Manual') + ' - ' : '') + | |
| 915 | + (controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') + | |
| 916 | + (profile ? profile.short_name : environment.name) + | |
| 917 | + (@category ? " - #{@category.full_name}" : '') | |
| 918 | + ) | |
| 917 | 919 | end |
| 918 | 920 | |
| 919 | 921 | # DEPRECATED. Do not use this. |
| ... | ... | @@ -1285,11 +1287,13 @@ module ApplicationHelper |
| 1285 | 1287 | end |
| 1286 | 1288 | |
| 1287 | 1289 | def delete_article_message(article) |
| 1288 | - if article.folder? | |
| 1289 | - _("Are you sure that you want to remove the folder \"%s\"? Note that all the items inside it will also be removed!") % article.name | |
| 1290 | - else | |
| 1291 | - _("Are you sure that you want to remove the item \"%s\"?") % article.name | |
| 1292 | - end | |
| 1290 | + CGI.escapeHTML( | |
| 1291 | + if article.folder? | |
| 1292 | + _("Are you sure that you want to remove the folder \"%s\"? Note that all the items inside it will also be removed!") % article.name | |
| 1293 | + else | |
| 1294 | + _("Are you sure that you want to remove the item \"%s\"?") % article.name | |
| 1295 | + end | |
| 1296 | + ) | |
| 1293 | 1297 | end |
| 1294 | 1298 | |
| 1295 | 1299 | def expirable_link_to(expired, content, url, options = {}) | ... | ... |
app/helpers/layout_helper.rb
| ... | ... | @@ -93,7 +93,7 @@ module LayoutHelper |
| 93 | 93 | end |
| 94 | 94 | |
| 95 | 95 | def meta_description_tag(article=nil) |
| 96 | - article ? truncate(strip_tags(article.body.to_s), :length => 200) : environment.name | |
| 96 | + article ? CGI.escapeHTML(truncate(strip_tags(article.body.to_s), :length => 200)) : environment.name | |
| 97 | 97 | end |
| 98 | 98 | end |
| 99 | 99 | ... | ... |
app/views/layouts/application-ng.html.erb
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <meta property="og:url" content="<%= @page ? url_for(@page.url) : @environment.top_url %>"> |
| 18 | 18 | <meta property="og:title" content="<%= h page_title %>"> |
| 19 | 19 | <meta property="og:site_name" content="<%= profile ? profile.name : @environment.name %>"> |
| 20 | - <meta property="og:description" content="<%= @page ? truncate(strip_tags(@page.body.to_s), :length => 200) : @environment.name %>"> | |
| 20 | + <meta property="og:description" content="<%= meta_description_tag(@page) %>"> | |
| 21 | 21 | |
| 22 | 22 | <!-- site root --> |
| 23 | 23 | <meta property="noosfero:root" content="<%= Noosfero.root %>"/> | ... | ... |
public/designs/themes/base/footer.html.erb
| 1 | 1 | <div id="footer-links"> |
| 2 | - <a id="link-to-doc" class='icon-help'><%= link_to _('Manual'), '/doc' %></a> | |
| 2 | + <%= link_to _('Manual'), '/doc', id: "link-to-doc", class: 'icon-help' %> | |
| 3 | 3 | </div><!-- end id="footer-links" --> |
| 4 | 4 | <div id="copyright"> |
| 5 | 5 | <p><%= _('This social network uses <a href="http://noosfero.org/">Noosfero</a>, developed by %s and licensed under the <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a> version 3 or any later version.') % link_to('Colivre', 'http://colivre.coop.br/') %></p> | ... | ... |