New revs


  • Dadman with a boy
  • Posts: 16,044
Re: New revs
« Reply #2880,  »
[Commit revision e5868b1]
Author: Nao
Date: Mon, 20 Mar 2017 00:28:38 +0100
Stats: 1 file changed; +77 (insertions), -77 (deletions)

  • Fixed lightness value being treated is a 0-1 float instead of a 0-100% value. (Class-CSS.php)
  • Changed all array()'s to [] while I was at it. Looks so cool. But, yeah, dream on, I won't do it across the entire project. Maybe just the commonly loaded files. This has no influence on performance, so it's just to a developer's benefit. (Class-CSS.php)
Re: New revs
« Reply #2881,  »
[Commit revision d9f6873]
Author: Nao
Date: Mon, 20 Mar 2017 15:40:19 +0100
Stats: 1 file changed; +12 (insertions), -19 (deletions)

  • Simplified 'test' strings in the BBCode list. Looks like when the strings were originally moved to the database, extra useless backslashes were added to them. (Subs-BBC.php)
Re: New revs
« Reply #2882,  »
[Commit revision 7fdc0bd]
Author: Nao
Date: Mon, 20 Mar 2017 16:28:03 +0100
Stats: 2 files changed; +6 (insertions), -6 (deletions)

  • This is a follow-up to rev c92eb3fb73b94a545029e73a830540e5779dfd5c from October 2013. I'd changed the Mark Topic as Unread system to better accomodate for infinite scrolling, but it also broke 'regular' use of the feature by resetting the read post counter to the beginning of the page, instead of the last unread post. I've tweaked the files to always reset to the last unread post, unless (1) you're on a read page (in which case it will mark the LAST post in THAT page as unread), (2) you're in infinite scrolling mode and you just viewed a new page (here it'll simply mark the penultimate read page's last post as unread.) This sounds complicated, but it works better for me. Until, of course, someone tells me it's broken... (Display.php, Subs-Boards.php)
Re: New revs
« Reply #2883,  »
[Commit revision 26810ca]
Author: Nao
Date: Tue, 28 Mar 2017 19:37:01 +0200
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • Undefined variable when posting. Yeah, that pretty much broke your new feature Cereal, didn't it..? ^^ (Post2.php)

[Commit revision f02dd70]
Author: Nao
Date: Tue, 28 Mar 2017 19:39:16 +0200
Stats: 2 files changed; +3 (insertions), -1 (deletion)

  • Removed debug code. Not even mine... (Class-Packer.php)
  • Now removing comments by myself before submitting them to Packer. Why? Because its over-complex removal code returns errors when compiling on some servers. (At least the one I'm on.) (Subs-Cache.php)

[Commit revision fe47054]
Author: Nao
Date: Tue, 28 Mar 2017 19:42:59 +0200
Stats: 1 file changed; +0 (insertion), -1 (deletion)

  • Removed more debug code. Not even mine, again. Ah ah. And not even from the same guy as the previous commit's. (Subs-BBC.php)
Re: New revs
« Reply #2884,  »
[Commit revision b42ffae]
Author: Nao
Date: Wed, 29 Mar 2017 12:03:12 +0200
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • So, hmm... I forgot to add whitespace search before // comments in the Packer code. Yeah, well, what can I say, I'm busy. Sorry for the mess with 'http://' strings... I double-checked, and none of my JS files use comments without whitespace before them. (Subs-Cache.php)
Re: New revs
« Reply #2885,  »
[Commit revision 2f082c8]
Author: Nao
Date: Wed, 29 Mar 2017 12:45:48 +0200
Stats: 5 files changed; +5 (insertions), -5 (deletions)

  • A few captcha images, typically the static ones, were being deleted twice. Once in Subs-Captcha.php, and once in their class' destructor. (captcha-grid.php, captcha-ledicons.php, captcha-ledicons_anim.php, captcha-silhouette.php, captcha-stripes.php)
Re: New revs
« Reply #2886,  »
[Commit revision 7196a1f]
Author: Nao
Date: Wed, 29 Mar 2017 23:10:05 +0200
Stats: 3 files changed; +4 (insertions), -3 (deletions)

  • Another potential fix for non-cooperating PHP versions that complain about empty buffers. (Subs.php)
  • Fixed weird menu background color in Warm. (Warm/extra.css)
  • Useless + sign. (wraph.js)

[Commit revision 2e9a0be]
Author: Nao
Date: Wed, 29 Mar 2017 23:12:36 +0200
Stats: 1 file changed; +36 (insertions), -19 (deletions)

  • Replaced board state icon (except for IE8 and older) with a CSS representation of the same thing. It looks better, and it saves at least 300 bytes off the gzipped CSS file. And it's Firefox-friendly. If you need to replace the icon, you can always reset the class entirely. Seriously, it's a cool update. (sections.css)
Re: New revs
« Reply #2887,  »
[Commit revision 81d0842]
Author: Nao
Date: Mon, 03 Apr 2017 22:30:42 +0200
Stats: 1 file changed; +49 (insertions), -36 (deletions)

  • Renamed wesql::$_db_con to wesql::$link (more in line with docs), and made it public, because, well, I've found several occasions where it made life easier. (Class-DB.php)
  • For some reason (and why didn't I see that before?), SQL queries can only use single quotes, no double quotes, when quoting a string. The query checker would bother me with that. Rewrote parser to account for both situations. (Class-DB.php)
  • Optimized query check speed. Previously it would strip strings and whitespace, then test for a few specific strings. From now on it will first test for those strings, and THEN, if it finds something something, it will strip strings and whitespaces, and double-check those strings. Meaning it's now slower for actual problematic queries (which you would normally be fixing immediately!), and faster when there's nothing to be worried about. (Class-DB.php)
  • wesql::get() will now double-check the kind of data it's returning. It should either be a mysqli_result object (normally what we're expecting), or a boolean (in case we called that method by mistake and actually meant for a ::query call, but what do you know...) (Class-DB.php)

[Commit revision 823b176]
Author: Nao
Date: Mon, 03 Apr 2017 22:32:17 +0200
Stats: 3 files changed; +36 (insertions), -40 (deletions)

  • Your avatar in the sidebar now links to your profile page. Some people told me it made more sense. I'm always willing to listen to people who don't know a thing about forum software conventions. (index.template.php)
  • If an avatar was resized in notification popups, its height wouldn't be. Ewww. (index.css)
  • Arraynazi. (Class-Notification.php)

[Commit revision 931e43e]
Author: Nao
Date: Mon, 03 Apr 2017 22:34:48 +0200
Stats: 2 files changed; +2 (insertions), -2 (deletions)

  • PHP 5.4+ already includes E_STRICT by default in E_ALL. (index.php)
  • notify_period has a maximum value of 127, so it should ensure we don't try to set it above that. (Notifications.php)

[Commit revision 5a9a005]
Author: Nao
Date: Mon, 03 Apr 2017 22:37:57 +0200
Stats: 1 file changed; +10 (insertions), -15 (deletions)

  • It would seem that there's a possibility PHP already destroyed all static objects before calling some session detructors, thus making it impossible to use wesql in them. So I'm changing those functions to use mysqli directly. It's not like I'm planning to add support for other DB systems, eh. (Load.php)
  • If visiting pages that generate many errors, admins could be locked out of them due to the debug queries being too long. (Load.php)

[Commit revision 137e34e]
Author: Nao
Date: Mon, 03 Apr 2017 22:39:26 +0200
Stats: 4 files changed; +8 (insertions), -4 (deletions)

  • Some more protections for output buffer handling. I've tested those for a few days now and haven't seen any errors pop up. (Subs-Sound.php, Security.php, Dlattach.php, Errors.php)

[Commit revision 3fd433f]
Author: Nao
Date: Mon, 03 Apr 2017 22:40:54 +0200
Stats: 1 file changed; +2 (insertions), -0 (deletion)

  • JSMin didn't correctly minify additions where the second member was quick cast as an integer, e.g. "a + +b". (Class-JSMin.php)

[Commit revision e6200f6]
Author: Nao
Date: Mon, 03 Apr 2017 22:42:58 +0200
Stats: 1 file changed; +10 (insertions), -27 (deletions)

  • Well, this one's a thing of beauty... In the auto-suggest JS code, handleSubmit would go to great lengths to return a boolean value, which... was never used in the end. I checked, and it's the same in all versions of SMF. Looks like someone didn't do their cleanup properly! Removing these tests saves a good 300 bytes! (suggest.js)

[Commit revision 14558bd]
Author: Nao
Date: Mon, 03 Apr 2017 22:45:21 +0200
Stats: 2 files changed; +5 (insertions), -7 (deletions)

  • I'll go out on a limb and say that when an admin disables execution time debug data, it's because they don't want anyone to see it. It's always good to keep an eye on your page loading performance, all right? (Subs-Template.php)
  • A cool bit-based trick that saves at least a millionth of a millisecond. I'm sure. I should use it everywhere... No? (Profile-View.php)
Re: New revs
« Reply #2888,  »
[Commit revision 12911e5]
Author: Nao
Date: Mon, 03 Apr 2017 22:56:07 +0200
Stats: 1 file changed; +5 (insertions), -13 (deletions)

  • I committed some debug code by mistake. Well, it's not debug code, it's code to disable MySQL strict mode, but I'm not sure it should be implemented that way. Heck, maybe I should even disable it altogether. That mode sucks, it's not even faster or anything... (Class-DB.php)
Re: New revs
« Reply #2889,  »
[Commit revision 9184d00]
Author: Nao
Date: Fri, 07 Apr 2017 15:51:32 +0200
Stats: 3 files changed; +5 (insertions), -5 (deletions)

  • Attempting to fix the slight annoyance of seeing orange notifications in the top left corner when they were already viewed in another tab. (script.js)
  • Allow for external URLs in weUrl. Not used in Wedge, but confirmed useful for other purposes. (script.js)
  • Updated jQuery from 3.1.1 to 3.2.1. (jquery-*.js, Load.php)
Re: New revs
« Reply #2890,  »
[Commit revision f89d6d6]
Author: Nao
Date: Fri, 07 Apr 2017 15:52:34 +0200
Stats: 1 file changed; +6 (insertions), -1 (deletion)

  • And of course I forgot to check the script.js box... Re-adding the log here.
  • ! Attempting to fix the slight annoyance of seeing orange notifications in the top left corner when they were already viewed in another tab. (script.js)
  • Allow for external URLs in weUrl. Not used in Wedge, but confirmed useful for other purposes. (script.js)
Re: New revs
« Reply #2891,  »
[Commit revision e850d4a]
Author: Nao
Date: Fri, 07 Apr 2017 15:54:52 +0200
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • Stats pages would still show a topic title in 50% width even in mobile mode, where 100% was a given. (sections.css)
Re: New revs
« Reply #2892,  »
[Commit revision 57b05c2]
Author: Nao
Date: Sun, 16 Apr 2017 14:31:50 +0200
Stats: 2 files changed; +0 (insertion), -544 (deletions)

  • I don't think I need a fallback JSON function. Really, I added that because the documentation mentioned something about PECL and I thought it needed to be installed, when actually it meant "PHP 5+ or PHP 4 with PECL", and since we don't support PHP 4... (Class-JSON.php, Subs.php)

[Commit revision 8d8f49f]
Author: Nao
Date: Sun, 16 Apr 2017 14:33:51 +0200
Stats: 1 file changed; +6 (insertions), -3 (deletions)

  • Firefox and recent IE require inline SVG to be URL-encoded. (Class-CSS.php)
  • Don't bother inlining SVG images for IE8 and older, because they don't support it... Might as well save some bandwidth here. (Class-CSS.php)
  • There's no need to specify a charset for inline SVG. (Class-CSS.php)
Re: New revs
« Reply #2893,  »
[Commit revision e80acb5]
Author: Nao
Date: Tue, 18 Apr 2017 01:27:11 +0200
Stats: 1 file changed; +12 (insertions), -20 (deletions)

  • Two new techniques for the key-value file cache, to combat possible race conditions. First of all, Wedge will no longer attempt to delete an expired file when it sees it expired. It's the script's responsibility to regenerate the cache (and thus the file) when it gets an invalid result (also, this saves more bytes, and I like saving bytes). Secondly, files are now created under a random name (like in Subs-CachePHP.php), and then renamed if everything works. This should help in a LOT of situations. And I'm serious. Just like I fixed race condition issues with the PHP minifier, I'm hoping this will also be the case here, although it happens much less often-- in fact the only reason I fought this is because Opera Chromium is bloody running two queries on my site at the exact same millisecond, even if I didn't ask for that. For once, it's Opera's fault. (Subs-Cache.php)
  • Seriously, someone should report that to them... Opera is actually loading Atom feeds even though I never added them to my feed list.
Re: New revs
« Reply #2894,  »
[Commit revision 5973dac]
Author: Nao
Date: Tue, 18 Apr 2017 13:42:43 +0200
Stats: 1 file changed; +12 (insertions), -9 (deletions)

  • Don't bother with backslashes inside comments, PHP ignores them anyway. (Subs-CachePHP.php)
  • PHP single-line comments can be 'stopped' by a ?> sign, this should fix it. However I haven't seen multi-line comments behave the same, so I'm leaving those aside for now. Would appreciate some feedback, but it's no big deal since ?> is barely used in Wedge. (Subs-CachePHP.php)
  • This actually fixes a bug (and only one) in Wedge-- that occurred when sending non-HTML posts in French. It was broken for the last 3 years, and I never understood why. Now I know. Someone at SMF used a backslash at the end of a comment. The fools.