Page Index Toggle Pages: 1 [2] 3 4  ReplyAdd Poll Send Topic
Very Hot Topic (More than 25 Replies) SVN 2.6.11 branch (Read 14717 times)
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #15 - Mar 20th, 2015 at 4:05pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 3:11pm:
Methinks the notification emails need more css - and other things.


Did we discover a bug, or...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #16 - Mar 20th, 2015 at 4:32pm
Mark & QuoteQuote  
Could be. I don't have time today to check it out but I'm guessing it's related to the "<" "/" getting interpolated in a weird way when being sent to Mail.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #17 - Mar 20th, 2015 at 5:31pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 4:32pm:
Could be. I don't have time today to check it out but I'm guessing it's related to the "<" "/" getting interpolated in a weird way when being sent to Mail.


Without actually seeing the raw e-mail, I can only assume it doesn't try to escape it even though it is obviously malformed html tag. So it "hides" everything until it finds next ">"...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #18 - Mar 20th, 2015 at 5:47pm
Mark & QuoteQuote  
Monni wrote on Mar 20th, 2015 at 5:31pm:
Without actually seeing the raw e-mail, I can only assume it doesn't try to escape it even though it is obviously malformed html tag. So it "hides" everything until it finds next ">"...
                     

Looking at the raw text, that's exactly what's happening in Outlook.  So I think a check on how the html is generated for the html e-mail needs a looking at.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #19 - Mar 20th, 2015 at 5:54pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 5:47pm:
Monni wrote on Mar 20th, 2015 at 5:31pm:
Without actually seeing the raw e-mail, I can only assume it doesn't try to escape it even though it is obviously malformed html tag. So it "hides" everything until it finds next ">"...
                   

Looking at the raw text, that's exactly what's happening in Outlook.  So I think a check on how the html is generated for the html e-mail needs a looking at.


Simple regex should work... escape "<" if it is not followed by ">" before next "<" or end of string.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #20 - Mar 20th, 2015 at 11:09pm
Mark & QuoteQuote  
Looking at the source code on this thread, I suspect the problem has to do with ">" sometimes being rendered as
Code
Select All
 ">&quot; 

rather than
Code
Select All
&quot;&gt;&quot; 

and"<" sometimes being rendered as
Code
Select All
 "<&quot; 

rather than
Code
Select All
&quot;&lt;&quot; 


This almost appears random as most if the time it's properly converted to html entities - but not always.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Zatthrus
New Member
*
Offline


I Love YaBB!

Posts: 4
Joined: Mar 11th, 2015
Awards: 1
Time Machine
Re: SVN 2.6.11 branch
Reply #21 - Mar 21st, 2015 at 2:42pm
Mark & QuoteQuote  
Monni wrote on Mar 20th, 2015 at 5:54pm:
Simple regex should work... escape "<" if it is not followed by ">" before next "<" or end of string.


Testing possible fix.
  
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Zatthrus
New Member
*
Offline


I Love YaBB!

Posts: 4
Joined: Mar 11th, 2015
Awards: 1
Time Machine
Re: SVN 2.6.11 branch
Reply #22 - Mar 21st, 2015 at 3:28pm
Mark & QuoteQuote  
test 2 :
XML and HTML5 have different reserved characters, so I see no problem with having inline JavaScript as long as it is validated to not contain "</", which would cause the block to terminate prematurely
  
Back to top
 
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #23 - Mar 21st, 2015 at 11:36pm
Mark & QuoteQuote  
Okay - Monni's test and Zathrus's test came in fine in Outlook. So the temporary fix for the notification e-mail glitch is:

In 2 places in Post.pm find
Code
Select All
    FromHTML($thismessage);
  


  and add after
Code
Select All
    $thismessage =~ s/>/&gt;/gsm;
     $thismessage =~ s/</&lt;/gsm; 



What was happening was that although there is a regex to strip out html tags, 'loose' pointy brackets get turned from '&lt;' to ">" in the FromHTML routine. The new code catches them and turns them back into html entities.

The regexes above this code need to be looked at as they're still sending the notification e-mails as txt even though YaBB now sends them as html.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #24 - Mar 22nd, 2015 at 2:06am
Mark & QuoteQuote  
And the odd issue of "> showing up in the source code (as rendered by FireFox), is an artifact of the autolink url function.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #25 - Mar 22nd, 2015 at 10:57am
Mark & QuoteQuote  
Dandello wrote on Mar 21st, 2015 at 11:36pm:
What was happening was that although there is a regex to strip out html tags, 'loose' pointy brackets get turned from '&lt;' to ">" in the FromHTML routine. The new code catches them and turns them back into html entities.

The regexes above this code need to be looked at as they're still sending the notification e-mails as txt even though YaBB now sends them as html.


Like I said earlier, the regex for stripping out html tags is actually incorrect, as it doesn't handle cases when there is second < before >. Instead of /<.*?>/ it should use

Code
Select All
 ~<(([a-z]+|[A-Z]+)( ?/?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))>~
  



... this makes sure it doesn't remove anything between invalid html tag and next valid html tag or invalid tag after valid html tag.

To the second point, I think the main issue is not the regexes above the FromHTML, but that we need to convert back the safe ones to html below the recent fix.
« Last Edit: Mar 22nd, 2015 at 1:31pm by Monni »  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #26 - Mar 22nd, 2015 at 1:30pm
Mark & QuoteQuote  
Since e-mails are now being sent as HTML, we should probably just use YaBBC to render the tags instead of stripping them out, and use regexes to add in inline styling for the quote and code boxes.

Expect to see some nonsense messages around here tomorrow or so as I test this idea.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #27 - Mar 22nd, 2015 at 1:36pm
Mark & QuoteQuote  
Dandello wrote on Mar 22nd, 2015 at 1:30pm:
Since e-mails are now being sent as HTML, we should probably just use YaBBC to render the tags instead of stripping them out, and use regexes to add in inline styling for the quote and code boxes.

Expect to see some nonsense messages around here tomorrow or so as I test this idea.


I agree with converting safe html tags to YaBB tags... But there is some html tags that are still better stripped off...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2234
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #28 - Mar 22nd, 2015 at 1:46pm
Mark & QuoteQuote  
Monni wrote on Mar 22nd, 2015 at 1:36pm:
But there is some html tags that are still better stripped off...
                     


We're going to have to go through and decide which ones can and should be stripped - and whether or not it would be advisable to use clipping so YaBB isn't sending out HUGE notification emails if the post character limits are set really high.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Paste Member Name in Quick Reply Box Monni
Language
***
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Mood: Frustrated
Zodiac sign: Pisces
Re: SVN 2.6.11 branch
Reply #29 - Mar 22nd, 2015 at 1:59pm
Mark & QuoteQuote  
Dandello wrote on Mar 22nd, 2015 at 1:46pm:
Monni wrote on Mar 22nd, 2015 at 1:36pm:
But there is some html tags that are still better stripped off...
                   


We're going to have to go through and decide which ones can and should be stripped - and whether or not it would be advisable to use clipping so YaBB isn't sending out HUGE notification emails if the post character limits are set really high.


Clipping or truncating is bad... It should just leave out the post contents if the post is too long... Clipping or truncating can cause issues in parsing HTML when closing tags gets clipped out but opening tag doesn't...
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
SVN 2.6.11 branch

Please type the characters exactly as they appear in the image,
without the first 2 and last 2 characters.
The characters must be typed in the same order,
and they are case-sensitive.
Open Preview Preview

You can resize the textbox by dragging the right or bottom border.
Off Topic Comment Insert Spoiler
Insert Hyperlink Insert FTP Link Insert Image Insert E-mail Insert Media Insert Table Insert Table Row Insert Table Column Insert Horizontal Rule Insert Teletype Insert Code Insert Quote Edited Superscript Subscript Insert List /me - my name Insert Marquee Insert Timestamp No Parse
Bold Italicized Underline Insert Strikethrough Highlight
                       
Change Text Color
Insert Preformatted Text Left Align Centered Right Align
resize_wb
resize_hb







Max 5000 characters. Remaining characters:
Text size: %
More Smilies
View All Smilies
Collapse additional features Collapse/Expand additional features Smiley Wink Cheesy Grin Angry Sad Shocked Cool Huh Roll Eyes Tongue Embarrassed Lips Sealed Undecided Kiss Cry