Page Index Toggle Pages: [1]  ReplyAdd Poll Send Topic
Very Hot Topic (More than 25 Replies) JavaScript errors (Read 12844 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
JavaScript errors
Aug 2nd, 2014 at 5:51pm
Mark & QuoteQuote  
ExtendedProfiles.pm and PostBox.pm both contain line
"return clipped" which is missing terminating semicolon... A few other lines in same function also lack semicolon and that will kill JavaScript in Chrome... Also... When new numeric settings are added to forum code during update/upgrade, admin must explicitly set new values or otherwise various forum features stop working because of stray semicolon error. When loading settings in admin panel, it should use safe default values if some setting doesn't exist in settings file.
  
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: JavaScript errors
Reply #1 - Aug 2nd, 2014 at 8:11pm
Mark & QuoteQuote  
Thanks.  Smiley
  

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


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: JavaScript errors
Reply #2 - Aug 2nd, 2014 at 8:39pm
Mark & QuoteQuote  
How it looks like there is probably still a bigger update in the SVN
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
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: JavaScript errors
Reply #3 - Aug 2nd, 2014 at 8:47pm
Mark & QuoteQuote  
You haven't seen what I've done to the Birthday list yet.  Grin
  

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


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: JavaScript errors
Reply #4 - Aug 2nd, 2014 at 9:34pm
Mark & QuoteQuote  
No. Tell me something.
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
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: JavaScript errors
Reply #5 - Aug 2nd, 2014 at 9:49pm
Mark & QuoteQuote  
I need to run a few more checks before it goes into the SVN but the newest version gives the admin the ability to break the list display into months and creates multiple pages. (And since the data is broken up, it's Big Board friendly. YaBB Forum's data actually loads in a reasonable amount of time. - as in it LOADS!  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: JavaScript errors
Reply #6 - Aug 2nd, 2014 at 10:13pm
Mark & QuoteQuote  
lol... stick to the topic...
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box pyragony54
Language
***
Offline


I Love YaBB!

Posts: 852
Location: Йошкар-Ола
Joined: May 25th, 2014
Gender: Male
Mood: Dead
Zodiac sign: Scorpio
Re: JavaScript errors
Reply #7 - Aug 2nd, 2014 at 10:17pm
Mark & QuoteQuote  
@ Monni

always stay nice and fluffy   Wink
  

if (idea == 'none') {use (manuals) && (Google | | search)}
if ($ answer == 0) {post (question)}
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: JavaScript errors
Reply #8 - Aug 2nd, 2014 at 10:44pm
Mark & QuoteQuote  
Monni wrote on Aug 2nd, 2014 at 10:13pm:
lol... stick to the topic...
                     


You know what happens to Yabbers who make comments like that?



They become moderators. 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: JavaScript errors
Reply #9 - Aug 3rd, 2014 at 8:09am
Mark & QuoteQuote  
Dandello wrote on Aug 2nd, 2014 at 10:44pm:
You know what happens to Yabbers who make comments like that?



They become moderators. Grin

In the first forum back in 2004 it took them about a week to promote me as an administrator... Because I was being such an annoying person...
I ended up kicking out 90% of the users, including main sponsor of the company running the forum.
  
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: URI::Escape
Reply #10 - Aug 3rd, 2014 at 2:25pm
 
Off-Topic replies have been moved to this Topic.
  

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: URI::Escape
Reply #11 - Aug 3rd, 2014 at 2:21pm
Mark & QuoteQuote  
On the javascript - I just uploaded edited copies of ExtendedProfiles and PostBox for testing. My initial tests on my home server didn't catch any js errors in Chrome.
  

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: JavaScript errors
Reply #12 - Aug 3rd, 2014 at 2:26pm
Mark & QuoteQuote  
There are times I swear MoveSplitSplice simply hates me.
  

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: JavaScript errors
Reply #13 - Aug 3rd, 2014 at 5:23pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 2:21pm:
On the javascript - I just uploaded edited copies of ExtendedProfiles and PostBox for testing. My initial tests on my home server didn't catch any js errors in Chrome.


People on the forum I upgraded noticed the missing semicolons because images in attachments stopped showing correctly. When I tried to debug the JavaScript code, it did suggest the error is on line number that is past end of the source code... After adding the missing semicolons it did correctly show the error is actually in the code that initializes board image scaling due to uninitialized variables. Like I mentioned in the first post the Perl code for injecting the values in JavaScript code is too simple and didn't default to 0 when the entry in settings file could not be read.
  
Back to top
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: JavaScript errors
Reply #14 - Aug 3rd, 2014 at 6:11pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 2:26pm:
There are times I swear MoveSplitSplice simply hates me.


You broke it again?
  
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: JavaScript errors
Reply #15 - Aug 3rd, 2014 at 6:58pm
Mark & QuoteQuote  
Monni wrote on Aug 3rd, 2014 at 6:11pm:
You broke it again?


No, it just hates me. (And it can't read my mind when I only want one post and forget to select that one post.  Wink)
  

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: JavaScript errors
Reply #16 - Aug 3rd, 2014 at 7:00pm
Mark & QuoteQuote  
Monni wrote on Aug 3rd, 2014 at 5:23pm:
People on the forum I upgraded noticed the missing semicolons because images in attachments stopped showing correctly. When I tried to debug the JavaScript code, it did suggest the error is on line number that is past end of the source code... After adding the missing semicolons it did correctly show the error is actually in the code that initializes board image scaling due to uninitialized variables. Like I mentioned in the first post the Perl code for injecting the values in JavaScript code is too simple and didn't default to 0 when the entry in settings file could not be read.
                   



Okay. I know where to look now.

Edited:
In theory, this should do it.
In Subs.pm find
Code (Perl)
Select All
    var avatar_img_w    = $max_avatar_width;
     var avatar_img_h    = $max_avatar_height;
     var fix_avatar_size = $fix_avatar_img_size;
     var avatarml_img_w    = $max_avatarml_width;
     var avatarml_img_h    = $max_avatarml_height;
     var fix_avatarml_size = $fix_avatarml_img_size;
     var post_img_w      = $max_post_img_width;
     var post_img_h      = $max_post_img_height;
     var fix_post_size   = $fix_post_img_size;
     var attach_img_w    = $max_attach_img_width;
     var attach_img_h    = $max_attach_img_height;
     var fix_attach_size = $fix_attach_img_size;
     var signat_img_w    = $max_signat_img_width;
     var signat_img_h    = $max_signat_img_height;
     var fix_signat_size = $fix_signat_img_size;
     var brd_img_w       = $max_brd_img_width;
     var brd_img_h       = $max_brd_img_height;
     var fix_brd_size    = $fix_brd_img_size; 



and replace with
Code (Perl)
Select All
    var avatar_img_w    = $max_avatar_width || 0;
     var avatar_img_h    = $max_avatar_height || 0;
     var fix_avatar_size = $fix_avatar_img_size;
     var avatarml_img_w    = $max_avatarml_width || 0;
     var avatarml_img_h    = $max_avatarml_height || 0;
     var fix_avatarml_size = $fix_avatarml_img_size;
     var post_img_w      = $max_post_img_width || 0;
     var post_img_h      = $max_post_img_height || 0;
     var fix_post_size   = $fix_post_img_size;
     var attach_img_w    = $max_attach_img_width || 0;
     var attach_img_h    = $max_attach_img_height || 0;
     var fix_attach_size = $fix_attach_img_size;
     var signat_img_w    = $max_signat_img_width || 0;
     var signat_img_h    = $max_signat_img_height || 0;
     var fix_signat_size = $fix_signat_img_size;
     var brd_img_w       = $max_brd_img_width || 0;
     var brd_img_h       = $max_brd_img_height || 0;
     var fix_brd_size    = $fix_brd_img_size; 

  

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: JavaScript errors
Reply #17 - Aug 3rd, 2014 at 7:31pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 7:00pm:
In theory, this should do it.


The problem is that the Perl parser can't know which part of the code is for Perl and which part is for the JavaScript code... it has to break the literal string to make it unambiguous.
  
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: JavaScript errors
Reply #18 - Aug 3rd, 2014 at 8:40pm
Mark & QuoteQuote  
Ah so.  Embarrassed
  

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: JavaScript errors
Reply #19 - Aug 3rd, 2014 at 8:49pm
Mark & QuoteQuote  
Another thing is that it should use // operator instead of || operator... as // means defined-or and || means true-or.
  
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: JavaScript errors
Reply #20 - Aug 3rd, 2014 at 9:09pm
Mark & QuoteQuote  
How about
Code
Select All
    if ($resize_num) {
 		$avatar_img_w    = $max_avatar_width || 0;
 		$avatar_img_h    = $max_avatar_height || 0;
 		$avatarml_img_w    = $max_avatarml_width || 0;
 		$avatarml_img_h    = $max_avatarml_height || 0;
 		$post_img_w      = $max_post_img_width || 0;
 		$post_img_h      = $max_post_img_height || 0;
 		$attach_img_w    = $max_attach_img_width || 0;
 		$attach_img_h    = $max_attach_img_height || 0;
 		$signat_img_w    = $max_signat_img_width || 0;
 		$signat_img_h    = $max_signat_img_height || 0;
 		$brd_img_w       = $max_brd_img_width || 0;
 		$brd_img_h       = $max_brd_img_height || 0;

         $resize_js =~ s/,$//xsm;
         $resize_js = qq~<script type="text/javascript">
     // resize image start
     var resize_time = 2;
     var img_resize_names = new Array ($resize_js);

     var avatar_img_w    = $avatar_img_w;
     var avatar_img_h    = $avatar_img_h;
     var fix_avatar_size = $fix_avatar_img_size;
     var avatarml_img_w    = $avatarml_img_w;
     var avatarml_img_h    = $avatarml_img_h;
     var fix_avatarml_size = $fix_avatarml_img_size;
     var post_img_w      = $post_img_w;
     var post_img_h      = $post_img_h;
     var fix_post_size   = $fix_post_img_size;
     var attach_img_w    = $attach_img_w;
     var attach_img_h    = $attach_img_h;
     var fix_attach_size = $fix_attach_img_size;
     var signat_img_w    = $signat_img_w;
     var signat_img_h    = $signat_img_h;
     var fix_signat_size = $fix_signat_img_size;
     var brd_img_w       = $brd_img_w;
     var brd_img_h       = $brd_img_h;
     var fix_brd_size    = $fix_brd_img_size;
  

  

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: JavaScript errors
Reply #21 - Aug 3rd, 2014 at 9:22pm
Mark & QuoteQuote  
Little better...

But like this...

Code
Select All
 Index: Subs.pm
 ===================================================================
 --- Subs.pm	(revision 1520)
 +++ Subs.pm	(working copy)
 @@ -818,6 +818,19 @@
  s/"((avatar|avatarml|post|attach|signat|brd)_img_resize)"([^>]*>)/ check_image_resize($1,$2,$3) /gesm;

      if ($resize_num) {
 +		$avatar_img_w    = $max_avatar_width // 0;
 +		$avatar_img_h    = $max_avatar_height // 0;
 +		$avatarml_img_w  = $max_avatarml_width // 0;
 +		$avatarml_img_h  = $max_avatarml_height // 0;
 +		$post_img_w      = $max_post_img_width // 0;
 +		$post_img_h      = $max_post_img_height // 0;
 +		$attach_img_w    = $max_attach_img_width // 0;
 +		$attach_img_h    = $max_attach_img_height // 0;
 +		$signat_img_w    = $max_signat_img_width // 0;
 +		$signat_img_h    = $max_signat_img_height // 0;
 +		$brd_img_w       = $max_brd_img_width // 0;
 +		$brd_img_h       = $max_brd_img_height // 0;
 +
          $resize_js =~ s/,$//xsm;
          $resize_js = qq~<script type="text/javascript">
      // resize image start
 @@ -824,23 +837,23 @@
      var resize_time = 2;
      var img_resize_names = new Array ($resize_js);

 -    var avatar_img_w    = $max_avatar_width;
 -    var avatar_img_h    = $max_avatar_height;
 +    var avatar_img_w    = $avatar_img_w;
 +    var avatar_img_h    = $avatar_img_h;
      var fix_avatar_size = $fix_avatar_img_size;
 -    var avatarml_img_w    = $max_avatarml_width;
 -    var avatarml_img_h    = $max_avatarml_height;
 +    var avatarml_img_w    = $avatarml_img_w;
 +    var avatarml_img_h    = $avatarml_img_h;
      var fix_avatarml_size = $fix_avatarml_img_size;
 -    var post_img_w      = $max_post_img_width;
 -    var post_img_h      = $max_post_img_height;
 +    var post_img_w      = $post_img_w;
 +    var post_img_h      = $post_img_h;
      var fix_post_size   = $fix_post_img_size;
 -    var attach_img_w    = $max_attach_img_width;
 -    var attach_img_h    = $max_attach_img_height;
 +    var attach_img_w    = $attach_img_w;
 +    var attach_img_h    = $attach_img_h;
      var fix_attach_size = $fix_attach_img_size;
 -    var signat_img_w    = $max_signat_img_width;
 -    var signat_img_h    = $max_signat_img_height;
 +    var signat_img_w    = $signat_img_w;
 +    var signat_img_h    = $signat_img_h;
      var fix_signat_size = $fix_signat_img_size;
 -    var brd_img_w       = $max_brd_img_width;
 -    var brd_img_h       = $max_brd_img_height;
 +    var brd_img_w       = $brd_img_w;
 +    var brd_img_h       = $brd_img_h;
      var fix_brd_size    = $fix_brd_img_size;

      noimgdir   = '$imagesdir';
  

  
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: JavaScript errors
Reply #22 - Aug 3rd, 2014 at 9:39pm
Mark & QuoteQuote  
Okay. Smiley
  

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: JavaScript errors
Reply #23 - Aug 3rd, 2014 at 9:45pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 9:39pm:
Okay. Smiley


Now can I get a mention in Special thanks for 2.6.1 for finding and fixing most of the bugs after release of 2.6.0.  Smiley
  
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: JavaScript errors
Reply #24 - Aug 3rd, 2014 at 10:12pm
Mark & QuoteQuote  
Oh, I'm sure there are still some waiting for you... Grin

But I do try to give credit where credit is due - and bug hunters are a valuable resource.
  

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: JavaScript errors
Reply #25 - Aug 3rd, 2014 at 10:41pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 10:12pm:
Oh, I'm sure there are still some waiting for you... Grin


I know... I'm just getting started... Like I mentioned in another thread, 2.6.1 shouldn't be current until we find all the bugs and hiccups and fix them Wink
  
Back to top
IP Logged
 
Paste Member Name in Quick Reply Box Batchman
Full Member
***
Offline


I Love YaBB!

Posts: 165
Location: Somewhere just East of Crazy
Joined: Jul 25th, 2014
Gender: Male
Mood: Depressed
Zodiac sign: Libra
Re: JavaScript errors
Reply #26 - Aug 4th, 2014 at 9:30pm
Mark & QuoteQuote  
Dandello wrote on Aug 3rd, 2014 at 2:26pm:
There are times I swear MoveSplitSplice simply hates me.
                     



Better than me ... you just have one small file that hates you. Computers hate me ... and when I love them so very much!

It's not fair, I tell you!
  

If you don't know where you are, but you don't care, you're not lost ... you're exploring!
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: JavaScript errors
Reply #27 - Aug 8th, 2014 at 3:37pm
Mark & QuoteQuote  
Code (Perl)
Select All
+		$avatar_img_w    = $max_avatar_width // 0; 



I knew there was a reason I didn't use the defined-or method. It came into use in Perl 5.10 and an awful lot of hosting services are still using Perl 5.8. (Including the VPS here for testing.)
  

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: JavaScript errors
Reply #28 - Aug 9th, 2014 at 6:15pm
Mark & QuoteQuote  
Dandello wrote on Aug 8th, 2014 at 3:37pm:
Code (Perl)
Select All
+            $avatar_img_w    = $max_avatar_width // 0; 



I knew there was a reason I didn't use the defined-or method. It came into use in Perl 5.10 and an awful lot of hosting services are still using Perl 5.8. (Including the VPS here for testing.)


We can't fix bad code with more bad code...

A // B equals defined A ? A : B
  
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: JavaScript errors
Reply #29 - Aug 10th, 2014 at 3:47pm
Mark & QuoteQuote  
I'm not arguing that the error catch is needed - just that we can't use the shortcut until/unless we announce that X version of YaBB will require a version of Perl newer that what a lot of hosts are still using.
  

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: JavaScript errors
Reply #30 - Aug 10th, 2014 at 4:50pm
Mark & QuoteQuote  
Dandello wrote on Aug 10th, 2014 at 3:47pm:
I'm not arguing that the error catch is needed - just that we can't use the shortcut until/unless we announce that X version of YaBB will require a version of Perl newer that what a lot of hosts are still using.


I know... My point was just "we" already decided 2.6.2 will break backwards compatibility with legacy character set support. It really doesn't hurt to break more backwards compatibility issues especially if third-world country like Finland is already using Perl 5.10.1.

Problem with older Perl installations is not just the version of Perl, but more and more currently commonly used modules are missing from standard installations because they were not required or needed back when 5.8 was the latest version.
  
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: JavaScript errors
Reply #31 - Aug 10th, 2014 at 5:10pm
Mark & QuoteQuote  
And I think 2.6.2 will be the point where we have to declare that YaBB needs a newer Perl to run. (2.6.0 broke the templates and mods, 2.6.2 will break darn near everything else to get us on a better track for moving forward.)

I'm keeping notes on the backwards compatibility things that can be tossed in 2.6.2. (There are more language encoding things that can be removed and our server gurus know of some spots where we should just yank out a couple sub routines that were written to solve problems that don't exist in modern server software. We'll also be looking at doing things like sequestering Mods away from the main code as much as possible - that may be a 2.6.1 change since we don't have that many 2.6.0 mods and they're still mostly in the alpha stage. )
  

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: JavaScript errors
Reply #32 - Aug 10th, 2014 at 5:24pm
Mark & QuoteQuote  
I'm still going to mix and match stuff even when 2.6.2 comes out as I don't think my clients are eager to switch to UTF-8.
  
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: JavaScript errors
Reply #33 - Aug 10th, 2014 at 6:01pm
Mark & QuoteQuote  
One of the beauties of OpenSource - You CAN mix and match. (And we may keep the ANSI/UTF-8 language files for quite some time. I'm not finding a good way to auto convert old CP1251 files to UTF-8 on a forum with mixed encoding. And doing it by hand on a large forum with mixed encoding will be a major pain in the arse. With this in mind the default character encoding setting in the Admin Center may go as it's not working as well as we'd hoped.)
  

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: JavaScript errors
Reply #34 - Aug 10th, 2014 at 7:14pm
Mark & QuoteQuote  
It all comes to the probability of having some character that is invalid in all except one encoding... In ISO 8859-1 character codes 127-159 are invalid, in CP1251 character code 152 is invalid, in UTF-8 all character codes above 127 must follow one of the following patterns:

194-223 + 128-191
224-239 + 160-191 + 128-191
240-247 + 144-191 + 128-191 + 128-191
248-251 + 136-191 + 128-191 + 128-191 + 128-191
252-253 + 132-191 + 128-191 + 128-191 + 128-191 + 128-191

This leaves quite a lot of character codes and sequences invalid.
  
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: JavaScript errors
Reply #35 - Aug 10th, 2014 at 8:41pm
Mark & QuoteQuote  
Where I'm having trouble is probably a combination of coding on a Windows machine and the fact that I haven't yet found a Perl based character encoding detector that can even semi-accurately detect the difference between an ISO-8859-1 string and a CP1251 string. (But I haven't exhausted all the possible options.)

Once we get around that then we'll be able to better handle non-Latin1 data.

  

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: JavaScript errors
Reply #36 - Aug 10th, 2014 at 8:54pm
Mark & QuoteQuote  
Dandello wrote on Aug 10th, 2014 at 8:41pm:
Where I'm having trouble is probably a combination of coding on a Windows machine and the fact that I haven't yet found a Perl based character encoding detector that can even semi-accurately detect the difference between an ISO-8859-1 string and a CP1251 string. (But I haven't exhausted all the possible options.)

Once we get around that then we'll be able to better handle non-Latin1 data.


Like I said earlier, ISO-8859-1 has more invalid characters, but for semi-accurate detection you also need to know which language the ISO-8859-1 text is as some high ASCII pairs are very unlikely in ISO-8859-1 even though they are technically valid.
With CP1251 it is more likely for text to contain more than 1 consecutive character in range 160-191 or 2 consecutive characters in range 192-255.
  
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: JavaScript errors
Reply #37 - Aug 10th, 2014 at 10:54pm
Mark & QuoteQuote  
I'm actually pondering the best way to detect the CP1251 strings by using two or three characters together and checking against the non-ISO character list. There actually wouldn't be much of a problem at all with CP1251 except that there are overlaps in the character codes so ä gets converted to something else that's not right.

As for most YaBB forums the encoding will most likely be Latin1 or CP1251 as Chinese is converted internally to html entities. Had the guys done that with Cyrillic early on there wouldn't be a problem now.
  

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: JavaScript errors
Reply #38 - Aug 11th, 2014 at 5:25pm
Mark & QuoteQuote  
Dandello wrote on Aug 10th, 2014 at 10:54pm:
I'm actually pondering the best way to detect the CP1251 strings by using two or three characters together and checking against the non-ISO character list. There actually wouldn't be much of a problem at all with CP1251 except that there are overlaps in the character codes so ä gets converted to something else that's not right.

As for most YaBB forums the encoding will most likely be Latin1 or CP1251 as Chinese is converted internally to html entities. Had the guys done that with Cyrillic early on there wouldn't be a problem now.


By taking "ä" as an example, it is very likely that one of the surrounding characters is either "ä", "Ä" or low ASCII... that way you can eliminate out Cyrillic text. Using three characters and assuming there can't be three consecutive high ASCII characters in Latin-1 text, the result should be pretty promising... so patterns like:
1. low-ASCII + ä + word-boundary
2. low-ASCII + ä + ä
3. low-ASCII + ä + low-ASCII
4. Ä or ä + ä + low-ASCII
5. Ä or ä + low-ASCII + ä

low-ASCII here means a-z, A-Z, word-boundary means any low-ASCII character except a-Z or A-Z or any valid high-ASCII character that is not a-z or A-Z with diacritical marks, meaning character codes 32-64, 91-96, 123-126, 160-191, 215 or 247.

Care should be taken not to mistake Latin-15 (Latin-9, Windows-28605) encoded text as invalid Latin-1 text, because those can be used interchangeably. Latin-15 uses also character codes 166, 168, 180, 184 and 188-190 for letters.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 
ReplyAdd Poll Send Topic
Bookmarks: del.icio.us Digg Facebook Google LinkedIn reddit Twitter Yahoo
JavaScript errors

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