Page Index Toggle Pages: [1]  ReplyAdd Poll Send Topic
Very Hot Topic (More than 25 Replies) SVN 2.6.11 branch (Read 14756 times)
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
YaBB Modder
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
SVN 2.6.11 branch
Mar 18th, 2015 at 5:38pm
Mark & QuoteQuote  
If someone (like Monni) would be so kind as to double check the files in the zip before they get uploaded to the SVN

There are a lot of little fixes - things like line ends, removing hard tabs, fixing hardcoded language, javascript and html validation.
And of course, bug fixes.
The file is at 2.6.11_fixa.zip (It's too big to just add an an attachment.)

Edited:
I forgot the dupes in the Paths.pm editor in AdminEdit.pm - that fix isn't in the zip.
  

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 #1 - Mar 19th, 2015 at 1:27pm
Mark & QuoteQuote  
Dandello wrote on Mar 18th, 2015 at 5:38pm:
If someone (like Monni) would be so kind as to double check the files in the zip before they get uploaded to the SVN

There are a lot of little fixes - things like line ends, removing hard tabs, fixing hardcoded language, javascript and html validation.
And of course, bug fixes.
The file is at 2.6.11_fixa.zip (It's too big to just add an an attachment.)

Edited:
I forgot the dupes in the Paths.pm editor in AdminEdit.pm - that fix isn't in the zip.


I'm pretty sure it's still bad... I have to finish comparing the files, but some things just don't look good...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #2 - Mar 19th, 2015 at 1:48pm
Mark & QuoteQuote  
The fixes for the non-Latinate attachment name transliteration may still need some work. And there may be an issue with the attachment name transliteration and multiple char encodings on the forum.

Maybe a note for non-Latinate users that the name of the file they're uploading needs to be in ASCII otherwise it will upload as '_______.*'
  

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: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #4 - Mar 19th, 2015 at 7:10pm
Mark & QuoteQuote  
Just went through your catches (new zip is at 2.6.11_fixb.zip).

I removed the Holly Hack from Templates/Admin/default.css - there's a problem with going between ANSI and UTF-8 char encoding with it and this bit of code isn't in Templates/Forum/default.css. We do need to check to make sure we don't have any uncleared floats triggering the newer version of the Guillotine Bug in MSIE. (But the reports on that one date from 2010 and as far as I'm aware, nobody's reported having problems with it on YaBBForum.)
  

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 #5 - Mar 19th, 2015 at 10:20pm
Mark & QuoteQuote  
One more diff... lol... doing four-way merge, so didn't catch all the differences at first attempt... Can't even imagine how many hours it took to compare all the revisions...
  

2_6_11b_diff.zip ( 3 KB | 148 Downloads )
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #6 - Mar 19th, 2015 at 10:36pm
Mark & QuoteQuote  
Oh, I can imagine - I'm having to write down which install is which and what it was testing... (I only have about 20 different versions of YaBB on my home server.  Grin )
  

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 #7 - Mar 19th, 2015 at 10:41pm
Mark & QuoteQuote  
Dandello wrote on Mar 19th, 2015 at 10:36pm:
Oh, I can imagine - I'm having to write down which install is which and what it was testing... (I only have about 20 different versions of YaBB on my home server.  Grin )

I only have 12 versions of YaBB here, so keep patching Wink
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #8 - Mar 20th, 2015 at 1:10pm
Mark & QuoteQuote  
On a related note: should we have all the inline javascript inside the ![CDATA] code?
  

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 #9 - Mar 20th, 2015 at 2:07pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 1:10pm:
On a related note: should we have all the inline javascript inside the ![CDATA] code?


It's only required if the JavaScript code contains characters that have special meaning in XML or XHTML... Chrome seems to be very picky about pages that don't use CDATA. The result is pretty unpredictable. Same goes for not having trailing ; in inline styles or JavaScript code, especially inside element attributes.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #10 - Mar 20th, 2015 at 2:11pm
Mark & QuoteQuote  
So none of this will be an issue once we go all HTML5 in 2.6.2 (except possibly in the RSS feed)? (Except for the trailing ';' in inline styles and javascript?)
  

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 #11 - Mar 20th, 2015 at 2:19pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 2:11pm:
So none of this will be an issue once we go all HTML5 in 2.6.2 (except possibly in the RSS feed)? (Except for the trailing ';' in inline styles and javascript?)

As far as I know about HTML5, those kind of inline JavaScript blocks are forbidden completely. (Section 8.1.2.6)
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #12 - Mar 20th, 2015 at 2:35pm
Mark & QuoteQuote  
An awful lot of HTML5 tutorials show inline javascript examples although I think many of the ones YaBB uses could be pushed to the bottom of the page.
  

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 #13 - Mar 20th, 2015 at 2:45pm
Mark & QuoteQuote  
Dandello wrote on Mar 20th, 2015 at 2:35pm:
An awful lot of HTML5 tutorials show inline javascript examples although I think many of the ones YaBB uses could be pushed to the bottom of the page.


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: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #14 - Mar 20th, 2015 at 3:11pm
Mark & QuoteQuote  
and this:
Code
Select All
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.  


made an interesting bit in the notification email:
Code
Select All
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 "http://yabbforumsoftware.com/cgi-bin/yabb2/YaBB.pl?num=1426700337/13#13 



Methinks the notification emails need more css - and other things.
  

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 #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
*****
Offline


I love YaBB 2.7!

Posts: 2235
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
*****
Offline


I love YaBB 2.7!

Posts: 2235
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
*****
Offline


I love YaBB 2.7!

Posts: 2235
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: 2235
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: 2235
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: 2235
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: 2235
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
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #30 - Mar 22nd, 2015 at 2:03pm
Mark & QuoteQuote  
Monni wrote on Mar 22nd, 2015 at 1:59pm:
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...
                     


Very true - the truncating function is iffy.
  

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: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #31 - Mar 23rd, 2015 at 3:14pm
Mark & QuoteQuote  
Okay - rolled back to the 'preformated, stripped text only' version of the e-mails. We'll come back to this when we start seriously looking at 2.6.2.

The
Code (Perl)
Select All
    $thismessage =~ s/<.*?>//g; 

in Post.pm should be okay in the short term because YaBB creates very simple html. So catching the extra (unmatched) sharp brackets after running through FromHTML should solve most of the current sharp brackets issues in e-mails.
  

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 #32 - Mar 23rd, 2015 at 6:26pm
Mark & QuoteQuote  
Dandello wrote on Mar 23rd, 2015 at 3:14pm:
Okay - rolled back to the 'preformated, stripped text only' version of the e-mails. We'll come back to this when we start seriously looking at 2.6.2.

The
Code (Perl)
Select All
    $thismessage =~ s/<.*?>//g; 

in Post.pm should be okay in the short term because YaBB creates very simple html. So catching the extra (unmatched) sharp brackets after running through FromHTML should solve most of the current sharp brackets issues in e-mails.


The problem with that was that the .* part also matches ">" which results in everything stripped between two html tags.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #33 - Mar 23rd, 2015 at 7:41pm
Mark & QuoteQuote  
That's the code everybody uses as an example of what works with very simple html tags. Plus
Code
Select All
*? 

is a 'lazy' or 'non-greedy' quantifier in Perl.  In this case the '>' marks the place it starts looking for matches before the '>', working backwards.
  

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 #34 - Mar 23rd, 2015 at 7:53pm
Mark & QuoteQuote  
Dandello wrote on Mar 23rd, 2015 at 7:41pm:
That's the code everybody uses as an example of what works with very simple html tags. Plus
Code
Select All
*? 

is a 'lazy' or 'non-greedy' quantifier in Perl.  In this case the '>' marks the place it starts looking for matches before the '>', working backwards.

It works when there is none stray < or >... But if there is even one stray >, it doesn't... it also fails miserably if there is no other characters between < and >, which is alternative way to say !=.

http://regexr.com/ is the tool I use to check regex patterns for bugs...
  

regex1.png ( 22 KB | 143 Downloads )
regex2.png ( 20 KB | 136 Downloads )
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #35 - Mar 23rd, 2015 at 9:01pm
Mark & QuoteQuote  
Which means that the issue with autolink urls will break it. Looking at how that section of code evolved I think we can probably remove the
Code
Select All
$thismessage =~ s/<.*?>//g; 

lines in while leaving the
Code
Select All
$thismessage =~ s/\[.*?\]//g; 

  that's a few lines above it because the chances of an errant ']' in YaBB is smaller than an errant '>'. (Plus that's what's been used, supposedy successfully for ages, in PM notifications.)

The supposed best solution is to use something like HTML:: Parser to remove the HTML tags.


  

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 #36 - Mar 23rd, 2015 at 9:39pm
Mark & QuoteQuote  
Dandello wrote on Mar 23rd, 2015 at 9:01pm:
Which means that the issue with autolink urls will break it. Looking at how that section of code evolved I think we can probably remove the
Code
Select All
$thismessage =~ s/<.*?>//g; 

lines in while leaving the
Code
Select All
$thismessage =~ s/[.*?]//g; 

  that's a few lines above it because the chances of an errant ']' in YaBB is smaller than an errant '>'. (Plus that's what's been used, supposedy successfully for ages, in PM notifications.)

The supposed best solution is to use something like HTML:: Parser to remove the HTML tags.




It is not big trouble to fix both YaBB and HTML tag detection as long as we know which characters can appear at start of tag and which characters can appear at end of tag... This is how I changed the HTML tag detection to detect everything else except comments, because those have very specific restrictions that make the regex very long...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #37 - Mar 24th, 2015 at 12:11am
Mark & QuoteQuote  
Um, this doesn't test out as a good regex in Perl.
Code
Select All
~<(([a-z]+|[A-Z]+)( ?/?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))>~ 



However this does:
Code (Perl)
Select All
~</?([A-Za-z](?>[^\s>/]*))(?>(?Sad?>[^>"']+)|"[^"]*"|'[^']*')*)>~ 

and it checks out at http://www.regexplanet.com/advanced/perl/index.html (The code is from O'Reilly's Regular Expressions Cookbook.)
  

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 #38 - Mar 24th, 2015 at 11:08am
Mark & QuoteQuote  
Dandello wrote on Mar 24th, 2015 at 12:11am:
However this does:
Code (Perl)
Select All
~</?([A-Za-z](?>[^s>/]*))(?>(?Sad?>[^>"']+)|"[^"]*"|'[^']*')*)>~ 

and it checks out at http://www.regexplanet.com/advanced/perl/index.html (The code is from O'Reilly's Regular Expressions Cookbook.)


It's still wrong... Initial / can't be optional... it's either initial / or final / but not both...

It is possible that it chokes on you because it still thinks / is special character even though it uses ~ as separator...

Alternative version with escaped / :
Code
Select All
 s/<(([a-z]+|[A-Z]+)( ?\/?|[^a-zA-Z<>][^<>]*[^\/<>]\/?)|\/([a-z]+|[A-Z]+))>//g
  

  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #39 - Mar 24th, 2015 at 1:35pm
Mark & QuoteQuote  
Code
Select All
Sequence (?/...) not recognized in regex; marked by <-- HERE in m/(?isx)<(([a-z]+|[A-Z]+)( ?/ <-- HERE ?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))>/ 


Code
Select All
Sequence (?\...) not recognized in regex; marked by <-- HERE in m/(?isx)<(([a-z]+|[A-Z]+)( ?\ <-- HERE /?|[^a-zA-Z<>][^<>]*[^\/<>]\/?)|\/([a-z]+|[A-Z]+))>/
  



It's the '?/?' that chokes.

You can test it out for Perl here: http://www.regexplanet.com/advanced/perl/index.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: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #40 - Mar 24th, 2015 at 1:47pm
Mark & QuoteQuote  
And so long as
Code (Perl)
Select All
</?([A-Za-z](?>[^s>/]*))(?>(?Sad?>[^>"']+)|"[^"]*"|'[^']*')*)> 

is set to global, it does work to remove just tags from code like this:
Code (HTML)
Select All
<p class="class">>>>test<<<</p><br /> 

  

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 #41 - Mar 24th, 2015 at 2:19pm
Mark & QuoteQuote  
Dandello wrote on Mar 24th, 2015 at 1:35pm:
Code
Select All
Sequence (?/...) not recognized in regex; marked by <-- HERE in m/(?isx)<(([a-z]+|[A-Z]+)( ?/ <-- HERE ?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))>/ 


Code
Select All
Sequence (?...) not recognized in regex; marked by <-- HERE in m/(?isx)<(([a-z]+|[A-Z]+)( ? <-- HERE /?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))>/
  



It's the '?/?' that chokes.

You can test it out for Perl here: http://www.regexplanet.com/advanced/perl/index.html


So it doesn't like the literal space character... that can be fixed by using \s instead.
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #42 - Mar 24th, 2015 at 2:47pm
Mark & QuoteQuote  
Okay. This one works according to http://www.regexplanet.com/advanced/perl/index.html
Code (Perl)
Select All
<(([a-z]+|[A-Z]+)(\s/?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))> 



and so does the one from Regular Expressions Cookbook page 426.
  

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 #43 - Mar 24th, 2015 at 3:36pm
Mark & QuoteQuote  
Dandello wrote on Mar 24th, 2015 at 2:47pm:
Okay. This one works according to http://www.regexplanet.com/advanced/perl/index.html
Code (Perl)
Select All
<(([a-z]+|[A-Z]+)(\s/?|[^a-zA-Z<>][^<>]*[^/<>]/?)|/([a-z]+|[A-Z]+))> 



and so does the one from Regular Expressions Cookbook page 426.


if you leave out ? after \s, it fails on tags like <br/>, but works for <br />...

on the other hand... YaBB chokes on \s when replying, strips off \, it's tricky because it has to match either 1 character or 2 characters because the next rule only matches 3 characters or more as it has to check the start of tag isn't mixed-case. Wink
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #44 - Mar 24th, 2015 at 4:13pm
Mark & QuoteQuote  
Okay according to http://www.regexplanet.com/advanced/perl/index.html

Code (Perl)
Select All
</?([A-Za-z](?>[^s>/]*))(?>(?Sad?>[^>"']+)|"[^"]*"|'[^']*')*)>  


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


behave the same even on some fairly tricky (and wrong) html.

And YaBB thoroughly trashes what's inside the code div when converting to e-mail text.

Tomorrow or so I'll look at true html e-mails again.
  

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 #45 - Mar 24th, 2015 at 4:30pm
Mark & QuoteQuote  
Dandello wrote on Mar 24th, 2015 at 4:13pm:
And YaBB thoroughly trashes what's inside the code div when converting to e-mail text.

Tomorrow or so I'll look at true html e-mails again.


YaBB trashes what's inside the code div even before converting to e-mail text Wink
I'm just going to not post anymore regex patterns because it just don't come out right Wink Too many slashes for YaBB to grok Wink
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #46 - Mar 24th, 2015 at 5:06pm
Mark & QuoteQuote  
Nothing wrong with putting them in a text file and attaching them.
  

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 #47 - Mar 24th, 2015 at 5:26pm
Mark & QuoteQuote  
Dandello wrote on Mar 24th, 2015 at 5:06pm:
Nothing wrong with putting them in a text file and attaching them.

That's what I usually do with longer spans of text... but fixing my own typos on text that is attached as a file takes a lot longer than fixing inlined text Wink
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 2235
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Mood: Annoyed
Zodiac sign: Virgo
Re: SVN 2.6.11 branch
Reply #48 - Apr 22nd, 2015 at 7:13pm
Mark & QuoteQuote  
Today's 2.6.11 zip is at 2.6.11_20150422.zip

The newest bug fixes (I hope.)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 
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