New revs

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: New revs
« Reply #2520, on March 19th, 2014, 07:37 PM »
[Commit revision 98cd9cf]
Author: Nao
Date: Wed, 19 Mar 2014 15:55:46 +0100
Stats: 3 files changed; +7 (insertions), -16 (deletions)

  • Moved $action_no_log to loadSettings, and removed extra_actions and nolog_actions variables. There are a couple of hooks where you can modify $action_list and $action_no_log, so I see no reason to have these features, apart from a very relative performance advantage. (index.php, Load.php)
  • Capitalization. (Install.english.php)

[Commit revision 4e06a33]
Author: Nao
Date: Wed, 19 Mar 2014 15:59:59 +0100
Stats: 1 file changed; +0 (insertion), -3 (deletions)

  • $cachedir is always set, no need to unset it first. And that security problem was solved in PHP 5.1.4 anyway, which is not even supported by Wedge. (index.php)

[Commit revision e6872cb]
Author: Nao
Date: Wed, 19 Mar 2014 17:54:01 +0100
Stats: 4 files changed; +8 (insertions), -24 (deletions)

  • Moved random seed generator to loadSettings, since it used to be called only twice, and systematically after loadSettings. (SSI.php, index.php, Load.php, Subs.php)

[Commit revision d5e9c81]
Author: Nao
Date: Wed, 19 Mar 2014 17:56:19 +0100
Stats: 1 file changed; +3 (insertions), -8 (deletions)

  • Minor code tweaks, mainly to match SSI with index.php. (SSI.php)

[Commit revision 1910c57]
Author: Nao
Date: Wed, 19 Mar 2014 19:22:53 +0100
Stats: 2 files changed; +18 (insertions), -13 (deletions)

  • Moved scheduled task launcher to loadSettings. I'm not 100% sure it'll stay there though, as I had to add a SSI test before running it... Not very clean. For now, I'm just trying to shrink the index down to the bare minimum. (Load.php)

[Commit revision 1015ede]
Author: Nao
Date: Wed, 19 Mar 2014 19:33:55 +0100
Stats: 3 files changed; +36 (insertions), -42 (deletions)

  • Moved all security headers to loadSettings. This one's interesting: there was a duplicate X-Frame-Options header being generated by both QueryString and index.php, which is a bad idea generally. (index.php, Load.php, QueryString.php)
  • Moved AJAX definition to loadSettings, while I was at it. (Load.php, QueryString.php)
  • Important security note: SSI will no longer go through the X-Frame-Options header, but it's for the best. It's up to the parent script to determine what headers they want to send, generally.

[Commit revision 667669a]
Author: Nao
Date: Wed, 19 Mar 2014 19:37:13 +0100
Stats: 1 file changed; +71 (insertions), -75 (deletions)

  • And the biggest one: removed the wedge_main() function, and moved all of its straightforward code to the main code. The code that determines the action name is now executed from its own function, determine_action(), which helps readability. An awful lot, if you ask me. (index.php)
Re: New revs
« Reply #2521, on March 20th, 2014, 05:22 PM »
[Commit revision b8ffdee]
Author: Nao
Date: Thu, 20 Mar 2014 16:27:47 +0100
Stats: 2 files changed; +4 (insertions), -4 (deletions)

  • version_compare is core PHP, duh! No need to test for it! (Class-DB.php, Errors.php)
  • Removed $pluginsdir from that place, while I'm at it. (Errors.php)

[Commit revision 3969e46]
Author: Nao
Date: Thu, 20 Mar 2014 17:22:40 +0100
Stats: 12 files changed; +179 (insertions), -225 (deletions)

  • $boarddir, $sourcedir, $cachedir, $pluginsdir, $cssdir and $jssdir are now all hard-coded, relative to ROOT_DIR (ex-$boarddir) which itself is determined through PHP. This is the second step towards making Wedge folder moves easier. (Class-CSS.php, Load.php, ManagePlugins.php, ManageSettings.php, OriginalFiles.php, QueryString.php, Subs-Plugins.php, Subs-Template.php, index.php, install.php, ManageSettings.english.php)
  • Fixed a PHP 5.3-only constant (__DIR__) showing up before it was allowed to. My, didn't I already do that before..?! (index.php)
  • Gained a portion of a microsecond or two for PHP 5.4+ by completely skipping the magic quote crap, including the function_exists test. It's approximately one billionth of the time it took me to type this, basically. But on every page. Don't complain. (index.php)
  • Removed folder presence tests at the start. If you want to remove them, well... That's your problem. Plus, I get to use a geeky syntax in this code block. (index.php)
  • Note: $pluginsdir/$pluginsurl and PLUGINS/PLUGINS_DIR are actually removed entirely, replaced by ROOT_DIR/ROOT hardcodings. They weren't used enough in the generic code flow to be worth a constant. Also removed CORE and CORE_DIR constants, for the same reasons, but I'm willing to restore constants by popular request.
  • Also, ROOT_DIR now automatically turns backslashes into slashes, reverting the need for that manipulation later on. I can see no reason why it couldn't be done so early!
Re: New revs
« Reply #2522, on March 20th, 2014, 06:18 PM »
[Commit revision fde20c5]
Author: Nao
Date: Thu, 20 Mar 2014 18:17:00 +0100
Stats: 10 files changed; +8 (insertions), -79 (deletions)

  • If your default (and only!) template folder isn't there, well, can't do anything for you! (Subs-Template.php, Errors.english.php)
  • Removed a remaining backslash transform. Feels so good, eh! (Subs-Cache.php)
  • Removed path settings page. $boardurl is now set through the basic settings page. (Admin.php, ManageSettings.php, Admin.english.php)
  • Removed remaining images_url, theme_url and theme_dir vars. (QueryString.php, ManageSettings.english.php)
Re: New revs
« Reply #2523, on March 21st, 2014, 12:03 AM »
[Commit revision 40bd3a9]
Author: Nao
Date: Fri, 21 Mar 2014 00:01:56 +0100
Stats: 1 file changed; +2 (insertions), -2 (deletions)

  • Interestingly (your mileage may vary), I took a bit of code from June 2012 and pasted it somewhere else to fix a bug, but I should have taken the July 2012 version instead. So I added a (minor) bug by fixing a larger one. It only generated an undefined index in the error log with no other consequences, no big deal. (Post2.php)

[Commit revision f14bb09]
Author: Nao
Date: Fri, 21 Mar 2014 00:02:29 +0100
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • Saving milli-microseconds for SSI, just like in index.php... (SSI.php)

[Commit revision 449e8d2]
Author: Nao
Date: Fri, 21 Mar 2014 00:03:13 +0100
Stats: 2 files changed; +3 (insertions), -18 (deletions)

  • Removing theme code... Slowly, but surely. But mostly slowly, okay. (Themes.php, Themes.template.php)
Re: New revs
« Reply #2524, on March 21st, 2014, 11:23 AM »
[Commit revision 317f05d]
Author: Nao
Date: Fri, 21 Mar 2014 11:22:59 +0100
Stats: 1 file changed; +1 (insertion), -7 (deletions)

  • AFAIK, media comments only have quick reply mode, not full page post mode. So, a preview page made no sense because it had nowhere to show its data. I could fix that into showing the data in the quick reply page, but... Seriously? Previewing a media item's comment? (Subs-Media.php)
  • Fixed wrong width for media comment editor. (Subs-Media.php)
Re: New revs
« Reply #2525, on March 21st, 2014, 06:39 PM »
[Commit revision 67effb0]
Author: Nao
Date: Fri, 21 Mar 2014 14:33:45 +0100
Stats: 1 file changed; +5 (insertions), -10 (deletions)

  • More $boarddir to ROOT_DIR. (OriginalFiles.php)

[Commit revision 633dc11]
Author: Nao
Date: Fri, 21 Mar 2014 14:54:32 +0100
Stats: 2 files changed; +118 (insertions), -3 (deletions)

  • Initial installation of Wedge will now automatically create the .htaccess file for you. I had a much more complete implementation that did without the IfModule tests, but then I realized it had to be solid enough to survive through Apache upgrades or removals. (index.php, OriginalFiles.php)

[Commit revision d9766ea]
Author: Nao
Date: Fri, 21 Mar 2014 15:22:25 +0100
Stats: 1 file changed; +25 (insertions), -46 (deletions)

  • Well, it looks like, despite what SMF's "official" htaccess said, there's nothing wrong in using php_flag in Apache 2... In fact, it's recommended on the PHP website, so... Whatever. Let's just go for short. (OriginalFiles.php)

[Commit revision 033c80b]
Author: Nao
Date: Fri, 21 Mar 2014 16:31:33 +0100
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • Removed IP range tests for Bing. This should help their newer bots crawl your website (I found at least one with an IP not from these ranges), and if you really need to keep testing against Bing, just enable hostname lookups, that particular test is still approved by Bing. (Security.php)

[Commit revision 406792e]
Author: Nao
Date: Fri, 21 Mar 2014 18:08:03 +0100
Stats: 2 files changed; +5 (insertions), -17 (deletions)

  • Smarter handling of PHPSESSID variables for search engines. First of all, moved the code to the template handler, then skipped it entirely if there's already a canonical URL. If there isn't, added a test for noindex (no need to remove the var if the engine can't index the page in the first place), and did a shorter and smarter replacement of the var. (index.php, Subs-Template.php)

[Commit revision 2fd73a1]
Author: Nao
Date: Fri, 21 Mar 2014 18:11:20 +0100
Stats: 1 file changed; +1 (insertion), -0 (deletion)

  • Disabling hostname lookups by default. There's no way to tell whether your server is up to the task, so let's not make it slower for no reason, right..? (install.sql)

[Commit revision 6d9bc44]
Author: Nao
Date: Fri, 21 Mar 2014 18:32:33 +0100
Stats: 2 files changed; +2 (insertions), -2 (deletions)

  • Added more document types to Aeva Media. More precisely, the fallback settings were missing a few of the defaults. Also added the .ass file format. Don't mention the name, thank you. (ManageMedia.php, install.sql)

[Commit revision 5786abc]
Author: Nao
Date: Fri, 21 Mar 2014 18:33:17 +0100
Stats: 1 file changed; +2 (insertions), -1 (deletion)

  • Also applied the PHPSESSID tweak to the log_error code. (Errors.php)

[Commit revision 8e1006b]
Author: Nao
Date: Fri, 21 Mar 2014 18:38:20 +0100
Stats: 1 file changed; +0 (insertion), -4 (deletions)

  • With the PHPSESSID rewrite done, I'm pretty sure I can remove this strange no_index request... (Home.php)
Re: New revs
« Reply #2526, on March 21st, 2014, 11:22 PM »
[Commit revision 343b3b5]
Author: Nao
Date: Fri, 21 Mar 2014 18:40:48 +0100
Stats: 1 file changed; +3 (insertions), -3 (deletions)

  • More $boardurl to ROOT. (Subs-Template.php)

[Commit revision df03738]
Author: Nao
Date: Fri, 21 Mar 2014 23:18:28 +0100
Stats: 1 file changed; +4 (insertions), -2 (deletions)

  • Layout tweaks on the login/reminder pages. (Login.template.php)

[Commit revision a41a40e]
Author: Nao
Date: Fri, 21 Mar 2014 23:22:02 +0100
Stats: 2 files changed; +14 (insertions), -7 (deletions)

  • Hopefully fixed a logic error when uploading media items. This patch took way longer to test and debug than to write, as often. Heck, I was never even able to reproduce the problem myself... (Aeva-Gallery.php)
  • Commenazi. (Class-Media.php)
Re: New revs
« Reply #2527, on March 22nd, 2014, 11:57 PM »
[Commit revision e9aa26f]
Author: Nao
Date: Sat, 22 Mar 2014 15:37:06 +0100
Stats: 2 files changed; +153 (insertions), -148 (deletions)

  • Moved template eval error handling to ManageErrors, where its 5KB of code won't get in the way of everyone, especially if template evals are disabled. (ManageErrors.php, Subs-Template.php)
  • An unused global had slipped through my web, becaue of a false false positive. (Subs-Template.php)

[Commit revision dd5104e]
Author: Nao
Date: Sat, 22 Mar 2014 19:26:11 +0100
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • $txt caching was broken with a global removal. (Subs-Template.php)

[Commit revision 8da1e80]
Author: Nao
Date: Sat, 22 Mar 2014 19:27:48 +0100
Stats: 14 files changed; +64 (insertions), -76 (deletions)

  • Removed $sourcedir entirely, replaced by APP_DIR. Fixed some SSI issues in the process. (SSI.php, index.php, Load.php, ManageErrors.php, ManagePaid.php, ManagePlugins.php, ManageSearch.php, Subs-Admin.php, Subs-Captcha.php, Subs.php, Aeva-Embed.php, Aeva-Gallery2.php, ManageMedia3.php)
  • Another $boardurl to ROOT. Also removed ROOT_DIR being redefined (discarded error.) (QueryString.php)

[Commit revision 383b164]
Author: Nao
Date: Sat, 22 Mar 2014 23:51:02 +0100
Stats: 1 file changed; +1 (insertion), -3 (deletions)

  • Attempting a flex-less design for banners which should work better across IE browsers. Always them, uh..? (index.css)

[Commit revision 72b65af]
Author: Nao
Date: Sat, 22 Mar 2014 23:52:41 +0100
Stats: 1 file changed; +3 (insertions), -2 (deletions)

  • Oh, yes, Wine also needed some extra help... I previously tried absolute positioning and then gave up on it, but in the case of Wine/Warm, doing it on the container (rather than h1/slogan) at least allows proper vertical positioning. (Wine/extra.css)

Posted: March 22nd, 2014, 11:53 PM

[Commit revision b79f3d6]
Author: Nao
Date: Sat, 22 Mar 2014 23:57:08 +0100
Stats: 1 file changed; +2 (insertions), -4 (deletions)

  • Who cares about an extra microsecond when it saves 50 bytes of code? What? In PHP? Okay, I just wanted to harmonize this block with Display.php's equivalent. (MessageIndex.php)
Re: New revs
« Reply #2528, on March 23rd, 2014, 08:24 PM »
[Commit revision 7c3a6b3]
Author: Nao
Date: Sun, 23 Mar 2014 16:21:49 +0100
Stats: 14 files changed; +67 (insertions), -79 (deletions)

  • Replaced all $boarddir occurrences with ROOT_DIR. Replaced most $boardurl with ROOT. Getting close! (Class-Editor.php, Class-FileWritable.php, ManageErrors.php, ManagePlugins.php, ManageServer.php, QueryString.php, Subs-Admin.php, Subs-Plugins.php, Subs-Template.php, Themes.php, ViewQuery.php, Aeva-Foxy.php, Aeva-Gallery.php, ManageMedia.php)

[Commit revision 599afb6]
Author: Nao
Date: Sun, 23 Mar 2014 20:04:42 +0100
Stats: 16 files changed; +66 (insertions), -70 (deletions)

  • Replaced $cachedir with CACHE_DIR, and $cssdir and $jsdir are now hardcoded below it. (Class-CSS.php, Class-DB.php, Class-Editor.php, Errors.php, Load.php, ManageErrors.php, ManageLanguages.php, ManageMail.php, ManageRegistration.php, QueryString.php, ScheduledTasks.php, Subs-Admin.php, Subs-BBC.php, Subs-Cache.php, Subs-Template.php)
  • Note: loadSource still uses a hardcoded cache dir, because it's declared after the first call to that function. I'll probably eventually move the declaration to the start.

[Commit revision d287660]
Author: Nao
Date: Sun, 23 Mar 2014 20:24:04 +0100
Stats: 2 files changed; +24 (insertions), -53 (deletions)

  • Rewrote the weekly maintenance task to go through an improved create_generic_folders function (which now supports re-creating deleted generic files inside non-deleted generic folders), instead of just dealing with the cache folder. That kind of task should probably be airing hourly rather than weekly, but it's a start... (ScheduledTasks.php)
  • CSS and JS cache htaccess files are now a bit shorter, because they no longer specify commands for the other (unused) type. (OriginalFiles.php)
Re: New revs
« Reply #2529, on March 23rd, 2014, 08:46 PM »
[Commit revision da5af8c]
Author: Nao
Date: Sun, 23 Mar 2014 20:31:07 +0100
Stats: 3 files changed; +2 (insertions), -116 (deletions)

  • 1 week is the same as 7 days... I think!! (install.sql)
  • Fixed readme text. (install/readme_install.html)
  • Removed main .htaccess file from install folder, now that it's created automatically at install time... I think!! (install/.htaccess)

[Commit revision 253119c]
Author: Nao
Date: Sun, 23 Mar 2014 20:32:37 +0100
Stats: 1 file changed; +0 (insertion), -5 (deletions)

  • Oh, yes, the index was still creating $boarddir, $cachedir, $cssdir and $jsdir... Well, off with their heads! Use constants now! (index.php)

[Commit revision 36986c1]
Author: Nao
Date: Sun, 23 Mar 2014 20:46:14 +0100
Stats: 5 files changed; +41 (insertions), -48 (deletions)

  • I'm not sure what made me think I was done with removing $cachedir and $boarddir from Wedge... Let's not talk about it, okay? (SSI.php, Subs-Cache.php, Subs-Plugins.php, install.php, install/ssi_examples.php)
Re: New revs
« Reply #2530, on March 23rd, 2014, 08:56 PM »
[Commit revision 85c6339]
Author: Nao
Date: Sun, 23 Mar 2014 20:55:50 +0100
Stats: 1 file changed; +19 (insertions), -24 (deletions)

  • Moved constants around and hopefully fixed the installer elegantly. Not tested for now. But it's broken in the first place, so might as well push it. (install.php)
Re: New revs
« Reply #2531, on March 24th, 2014, 06:41 PM »
[Commit revision 9ac202a]
Author: Nao
Date: Mon, 24 Mar 2014 18:30:43 +0100
Stats: 1 file changed; +1 (insertion), -1 (deletion)

  • cache_get_data should return null if caching is disabled. This was already the case (return === return null), but I like it to be explicit, it's easier to debug later. (Subs-Cache.php)

[Commit revision fc2ba13]
Author: Nao
Date: Mon, 24 Mar 2014 18:35:07 +0100
Stats: 6 files changed; +25 (insertions), -27 (deletions)

  • Rewrote Aeva Media to use a unified folder relative to the current Wedge path. Ah, good. I could have removed the folder altogether, but I wasn't too thrilled about rewriting all occurrences of data_dir_path and data_dir_url, so I chose to do half of the job in a few lines. (ManageMedia.php, Subs-Media.php, install.sql, ManageMedia.english.php)
  • Dropped $amSettings['enable_cache'] in favor of the system-wide variable (it is, after all, ALWAYS available, unlike in Aeva Media 1.x, which was also compatible with old code), and upped the AeMe settings cache to one hour, instead of a minute. (ManageMedia.php, Subs-Media.php, install.sql, ManageMedia.english.php)
  • Spacinazi. (ManageMedia2.php)

[Commit revision 65a4fcb]
Author: Nao
Date: Mon, 24 Mar 2014 18:40:37 +0100
Stats: 2 files changed; +4 (insertions), -6 (deletions)

  • Removed $enableCompressedData variable at install time; I'll replace it with a proper installation checkbox if I find the time to do it. Just relying on the server declaring itself as Apache unfortunately doesn't mean htaccess files will work withou extra manual steps, e.g. if AllowOverride is set to false. (install.php)
  • Renamed a few variables, while I was at it. Nothing important. (install.php, install.sql)
Re: New revs
« Reply #2532, on March 24th, 2014, 07:41 PM »
[Commit revision 0c03c5d]
Author: Nao
Date: Mon, 24 Mar 2014 19:39:37 +0100
Stats: 4 files changed; +5 (insertions), -10 (deletions)

  • Removed Flash express installer, a feature from another time. Aeva Media will eventually move on to exclusive HTML5 code, so let's at least remove this, as I never included the required SWF file in the repo anyway. Also replaced a $boardurl to ROOT. Not that many are left, phew... (Aeva-Embed.php, ManageMedia3.php, install.sql, ManageMedia.english.php)
Re: New revs
« Reply #2533, on March 25th, 2014, 10:16 AM »
[Commit revision 962885b]
Author: Nao
Date: Tue, 25 Mar 2014 10:16:38 +0100
Stats: 18 files changed; +63 (insertions), -66 (deletions)

  • And... $boardurl is almost entirely replaced with ROOT! I think I'm done with replacements, phew..! (SSI.php, install.php, Class-System.php, Load.php, ManageNews.php, ManagePaid.php, ManageSettings.php, PrettyUrls-Filters.php, Security.php, Subs-Auth.php, Subs-Cache.php, Subs-PrettyUrls.php, Subscriptions-PayPal.php, Upgrade.php, Aeva-Embed.php, Admin.template.php, Media.template.php, index.template.php)
  • So, as a reminder... These variables are replaced with their equivalent in parenthesis: $boardurl (ROOT), $boarddir (ROOT_DIR), $sourcedir (APP_DIR), $settings['theme_url'] (TEMPLATES), $settings['theme_dir'] (TEMPLATES_DIR), $settings['images_url'] (ASSETS), $settings['images_dir'] (ASSETS_DIR), and $cachedir (CACHE_DIR). Do not use the $variables, except for $boardurl if you're trying to override it before it's set in stone. I'm not even sure there's a hook for that, though...
Re: New revs
« Reply #2534, on March 25th, 2014, 07:50 PM »
[Commit revision 0b5bc99]
Author: Nao
Date: Tue, 25 Mar 2014 10:23:15 +0100
Stats: 2 files changed; +18 (insertions), -7 (deletions)

  • Don't offer a search scope select box in the search popup if we're not in a topic, and not even in a board. (Search2.php, Search.template.php)

[Commit revision 61f16c8]
Author: Nao
Date: Tue, 25 Mar 2014 17:40:22 +0100
Stats: 1 file changed; +2 (insertions), -2 (deletions)

  • Renamed a risky variable. (Notifications.php)

[Commit revision c38bfa9]
Author: Nao
Date: Tue, 25 Mar 2014 19:48:21 +0100
Stats: 12 files changed; +41 (insertions), -53 (deletions)

  • Renamed $context['protocol'] to PROTOCOL. (Class-System.php, Credits.php, ManageServer.php, PrettyUrls-Filters.php, QueryString.php)
  • Renamed hidden variable $settings['forum_alias_urls'] to $aliases, which can be set in Settings.php, of course. (QueryString.php, Subs-Auth.php)
  • Renamed $settings['pretty_remove_index'] to $remove_index. (ManageSettings.php, OriginalFiles.php, QueryString.php)
  • Renamed loadPaths to loadConstants, because it now initializes other constants, such as PROTOCOL and AJAX. (index.php, SSI.php, QueryString.php)
  • Added German to the list of detected languages for the installer. (install.php)
  • Constant problems in the installer (and potentially, upgrader) should now be fixed, thanks to loadConstants() being callable *before* database settings are loaded.
  • I think I'm done with constants, at least for now... :)

[Commit revision 7b6c637]
Author: Nao
Date: Tue, 25 Mar 2014 19:50:03 +0100
Stats: 1 file changed; +2 (insertions), -3 (deletions)

  • Forgot this one... Removed one of the last $boardurl occurrences, as redirectexit() now properly supports SCRIPT, even early in the loading process. (Upgrade.php)