{"id":7050,"date":"2014-05-17T00:25:09","date_gmt":"2014-05-17T00:25:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/17\/problem-about-sanitize-collection-of-common-programming-errors\/"},"modified":"2014-05-17T00:25:09","modified_gmt":"2014-05-17T00:25:09","slug":"problem-about-sanitize-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/17\/problem-about-sanitize-collection-of-common-programming-errors\/","title":{"rendered":"problem about sanitize-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/65f19b6f5a9b77b579e5be470e9e099c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnilsjesper<br \/>\nruby security jruby nokogiri sanitize<br \/>\nRan into some strange behavior with both Loofah and Sanitize while trying to clean up some html fragments when I noticed that times like &#8220;6:30pm&#8221; were turning into &#8220;30pm&#8221;.Did some investigation and found the following:Loofah.scrub_fragment(&#8220;&lt;span&gt;asdfasdf 6:30 pm&lt;\/span&gt;&#8221;, :strip).to_html #=&gt; &#8220;&lt;span&gt;asdfasdf 30 pm&lt;\/span&gt;&#8221; Loofah.scrub_fragment(&#8220;6:30 pm&#8221;, :strip).to_html #=&gt; &#8220;6:30 pm&#8221; Loofah.scrub_fragment(&#8220;&lt;foo&gt;asdfasdf 6&amp;#58;30 pm&lt;\/foo&gt;&#8221;, :strip).to_<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8d22585090624d7683365a1f81ec6866?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarius Pop<br \/>\nruby-on-rails ruby truncate sanitize redcloth<br \/>\nI have some text that I would like to output using RedCloth. I am trying to figure out how this works and I can&#8217;t get the result that I would like.Used Code:truncate(sanitize(RedCloth.new(&#8220;*some* interesting text&#8221;)).to_html, length: 6)Result:*some*Expected Result:some i&#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/o6Zfp.jpg?s=32&amp;g=1\" \/><br \/>\nRadim K\u00f6hler<br \/>\ncontent richtexteditor editable sanitize aloha-editor<br \/>\nI have multiple (6) editables with two different classes (.html_edit_simple, .html_edit_advanced) on website and I want to divide them by class and each to have its own contentHandler settings.But no matter what I try, only the default settings are loaded.The ones defined under window.Aloha.settings.contentHandler.handler.sanitize don&#8217;t apply at all.The settings code that I use is the following:(function(window, undefined) {if (window.Aloha === undefined || window.Aloha === null) {window.Aloha =<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0a7f6f3c8dd3f03528df11bdba12cc94?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npmc255<br \/>\nruby-on-rails controller helper sanitize<br \/>\nI&#8217;m trying to call sanitize within a controller. Here&#8217;s what I tried:class FooController &lt; ApplicationControllerinclude ActionView::Helpers::SanitizeHelper# &#8230; endHowever, I&#8217;m getting this error:undefined method `white_list_sanitizer&#8217; for FooController:ClassI searched around and people recommended switching the include line to include ActionView::Helpers, but that results in this error:undefined method `url_for&#8217; for nil:NilClassWhat&#8217;s the correct way to call sanitize? I&#8217;m using Rails 2.3.5.<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>nilsjesper ruby security jruby nokogiri sanitize Ran into some strange behavior with both Loofah and Sanitize while trying to clean up some html fragments when I noticed that times like &#8220;6:30pm&#8221; were turning into &#8220;30pm&#8221;.Did some investigation and found the following:Loofah.scrub_fragment(&#8220;&lt;span&gt;asdfasdf 6:30 pm&lt;\/span&gt;&#8221;, :strip).to_html #=&gt; &#8220;&lt;span&gt;asdfasdf 30 pm&lt;\/span&gt;&#8221; Loofah.scrub_fragment(&#8220;6:30 pm&#8221;, :strip).to_html #=&gt; &#8220;6:30 pm&#8221; Loofah.scrub_fragment(&#8220;&lt;foo&gt;asdfasdf [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7050","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7050"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7050\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}