Sunday, February 19, 2017

PHP 5.6 Patch reworked

Reworking the PHP 5.6 patch from August 2016, then posted in the Flatpress Forum on Januar 29, 2017.
» http://www.flatpress … /11465#Comment_11465

After a few tests fixed a Calendar and PrettyUrls plugin Problem.

fp-plugins/calendar/plugin.calendar.php on line 74

PHP Deprecated: Assigning the return value of new by reference is deprecated in …

fp-plugins/prettyurls/plugin.prettyurls.php on line 245

PHP Notice: Undefined index: PATH_INFO in …

fp-plugins/prettyurls/plugin.prettyurls.php on line 579

PHP Strict Standards: Declaration of admin_plugin_prettyurls::onsubmit() should be compatible with AdminPanelAction::onsubmit($data = NULL) …

Security and HTTPS

Adding Cookie security and HTTPS support for Flatpress 1.0.3 in the defaults.php file.

Cookie security

ini_set('session.cookie_httponly', 1);
ini_set('session.use_only_cookies', 1);

and if HTTPS is used

ini_set('session.cookie_secure', 1);

HTTPS support

if (isset($_SERVER['HTTPS'])) {
  $_SERVER['HTTPS'] = htmlspecialchars($_SERVER['HTTPS'], ENT_QUOTES, "UTF-8");
} 
$serverport = "false";
// Unterstützung für Apache und IIS 
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == '1' || strtolower($_SERVER['HTTPS'])=='on')) {	 
  $serverport = "https://";
  // Uses a secure connection (HTTPS) if possible 
  ini_set('session.cookie_secure', 1);
} else {		 
  $serverport = "http://";
}

...

$_SERVER['HTTP_HOST'] = htmlspecialchars($_SERVER[''HTTP_HOST'], ENT_QUOTES, "UTF-8");
define('BLOG_BASEURL', $serverport . $_SERVER['HTTP_HOST'] . BLOG_ROOT);

Please note

If you use user contributed Flatpress plugins, it is possible that these plugins won’t work with PHP 5.6!

Wednesday, August 24, 2016

First PHP 5.6 patch pack

First PHP 5.6 patch pack release for own use. Setting up a developer Flatpress blog for testing on Apache with PHP 5.6 and importing many entries from the old personal Flatpress project blog.

Get the current PHP 5.6 patch here:
» Downloads

Please note

If you use user contributed Flatpress plugins, it is possible that these plugins won’t work with PHP 5.6!

Saturday, December 6, 2014

PHP 5.6 experiments

Removing this errors and warnings messages by patching following files in Flatpress 1.0.3.

fp-includes/smarty/Smart_Compiler.class.php

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in …/fp-includes/smarty/Smarty_Compiler.class.php on line 270

Using solution from here:
http://www.modified-shop.org/forum/index.php?topic=27558.0

fp-includes/smarty/SmartyValidate.class.php

Error message Strict standards: Non-static method should not be called statically in php

fp-includes/core/core.fpdb.class.php

Strict Standards: Only variables should be passed by reference in …/fp-includes/core/core.fpdb.class.php on line 303

fp-includes/smarty/plugins/function.list_categories.php

Strict Standards: Only variables should be passed by reference in …/fp-includes/smarty/plugins/function.list_categories.php on line 35

login.php

Warning: Illegal string offset ‘logout’ in …/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^%%52^522^5225B40D%%login_success.tpl.php on line 3

Now Flatpress 1.0.3 will running on PHP 5.6 and you can use it like you want.

But beware

If you use user contributed Flatpress plugins, it is possible that these plugins won’t work with PHP 5.6!

Helpful Internet link

» http://www.modified- … ex.php?topic=27558.0

Thursday, November 20, 2014

PHP 5.6 quick and dirty patch

The first attempt to get Flatpress 1.0.3 running under PHP 5.6 is solved with this quick and dirty patch:

Adding the PHP command “error_reporting” in these listed files:

defaults.php - error_reporting(0);
login.php - error_reporting(0);
admin/main.php - error_reporting(0);

Now you can running Flatpress 1.0.3 without errors and warnings. This is a quick solution for everyone without PHP programming expertise.

Enjoy