Flatpress fulltext search warnings

Filed under PHP 7.1

Saturday
11.
March 2017

Remove a few warnings in the fulltext search. It seems to be an old bug, because it appears on older php versions with the same warning.

/search.php on line 88
Warning: Illegal string offset ‘fullparse’ in …
Warning: Cannot assign an empty string to a string offset in …
/search.php on line 91
Warning: Illegal string offset ‘fullparse’ in …
/search.php on line 116
Warning: Illegal string offset ‘fullparse’ in …
/search.php on line 119
Notice: Undefined index: content in …

PHP 7.1 - Adding security and Smarty Update

Filed under PHP 7.1

Saturday
25.
February 2017

Fixing a OWASP warning by adding a few lines to the defaults.php.

Defaults.php

//
// OWASP - Browser Cache - How can the browser cache be used in attacks?
//
header('Expires: Sun, 01 Jan 2015 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
//
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
//
// End of send header
//

And next step updating the in Flatpress included Smarty Template Engine Version to get a bit more security.

Interesting Links

» Github - Smarty Template Engine project
» OWASP - Browser Cache - How can the browser cache be used in attacks?
» Stack Overflow - How to prevent Browser cache for php site

First PHP 7.1 patch

Filed under PHP 7.1

Wednesday
22.
February 2017

After the quick and dirty PHP 7.1 experiments a stable solution must be created. First of all, Flatpress should run again without disabling the error reporting.

Errors and Warnings with Flatpress 1.0.3 and PHP 5.6 patch under PHP 7.1:

fp-includes/smarty/Smarty.class.php on line 64

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Smarty has a deprecated constructor in …

fp-includes/core/core.filesystem.php on line 12

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; fs_filelister has a deprecated constructor in …

fp-includes/core/core.filesystem.php on line 182

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; fs_chmodder has a deprecated constructor in …

fp-includes/core/core.cache.php on line 5

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cache_filelister has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 186

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; pairs has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 373

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; BPlusTree_Node_Fifo has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 416

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; BPlusTree_Node has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 1472

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; BPlusTree has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 2341

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; BPlusWalker has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 2535

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; SBPlusTree has a deprecated constructor in …

fp-includes/core/core.bplustree.class.php on line 2613

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; caching_SBPT has a deprecated constructor in …

fp-includes/core/core.widgets.php on line 9

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; widget_indexer has a deprecated constructor in …

fp-includes/core/core.comment.php on line 3

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; comment_indexer has a deprecated constructor in …

fp-includes/core/core.entry.php on line 3

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; entry_cached_index has a deprecated constructor in …

fp-includes/core/core.entry.php on line 36

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; entry_index has a deprecated constructor in …

fp-includes/core/core.entry.php on line 226

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; entry_archives has a deprecated constructor in …

fp-includes/core/core.draft.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; draft_indexer has a deprecated constructor in …

fp-includes/core/core.fpdb.class.php on line 3

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDB_QueryParams has a deprecated constructor in …

fp-includes/core/core.fpdb.class.php on line 136

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDB_Query has a deprecated constructor in …

fp-includes/core/core.fpdb.class.php on line 591

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDB_CommentList has a deprecated constructor in …

fp-includes/core/core.fpdb.class.php on line 637

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDB has a deprecated constructor in …

fp-includes/core/core.fpdb.class.php on line 765

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; FPDB_transaction has a deprecated constructor in …

fp-includes/core/core.plugins.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plugin_indexer has a deprecated constructor in …

fp-includes/smarty/SmartyValidate.class.php on line 33

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; SmartyValidate has a deprecated constructor in …

fp-includes/smarty/Smarty_Compiler.class.php on line 35

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Smarty_Compiler has a deprecated constructor in …

admin/includes/panels.prototypes.php on line 14

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AdminPanel has a deprecated constructor in …

admin/includes/panels.prototypes.php on line 93

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AdminPanelAction has a deprecated constructor in …

admin/panels/maintain/admin.maintain.php on line 17

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tpl_deleter has a deprecated constructor in …

admin/panels/maintain/admin.maintain.php on line 39

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; s_entry_crawler has a deprecated constructor in …

admin/panels/themes/admin.themes.php on line 3

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; admin_themes has a deprecated constructor in …

admin/panels/themes/admin.themes.style.php on line 3

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; admin_themes_obj_style_idx has a deprecated constructor in …

fp-plugins/bbcode/inc/stringparser.class.php on line 66

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; StringParser has a deprecated constructor in …

fp-plugins/bbcode/inc/stringparser.class.php on line 838

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; StringParser_Node has a deprecated constructor in …

fp-plugins/bbcode/inc/stringparser.class.php on line 1453

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; StringParser_Node_Text has a deprecated constructor in …

After fixing this errors and warnings Flatpress now runs under PHP 7.1. But there are a few more things to do. I’m using two Flatpress plugins from Fabrixx.m.

  • LastCommentsAdmin
  • MediaManager

fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php on line 41

Parse error: syntax error, unexpected ‘new’ (T_NEW) in …

fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php on line 44

Parse error: syntax error, unexpected ‘new’ (T_NEW) in …

fp-plugins/lastcommentsadmin/plugin.lastcommentsadmin.php on line 15

Warning: Declaration of admin_plugin_lastcommentsadmin::onsubmit() should be compatible with AdminPanelAction::onsubmit($data = NULL) in …

fp-plugins/mediamanager/panels/panel.mediamanager.file.php on line 242

Warning: Declaration of admin_uploader_mediamanager::onsubmit() should be compatible with AdminPanelAction::onsubmit($data = NULL) in …

These two Flatpress plugins from Fabrixx.m are included in this first PHP 7.1 patch.

Link to Fabrixx.m
» http://kirgroup.com/fabrixxm/

PHP 5.6 Patch reworked

Filed under PHP 5.6

Sunday
19.
February 2017

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!

PHP 7.1 experiments

Filed under PHP 7.1

Sunday
5.
February 2017

After the success with Flatpress 1.0.3 and PHP 5.6 the next difficulty comes over. PHP 5.6 support end is December 2018.

See PHP Supported Versions for more info:
» http://php.net/supported-versions.php

What do I do after December 2018 with Flatpress? So I startet the first PHP 7.1 experiments and it seems very easy to get Flatpress with patches running under PHP 7.1.

Add

ini_set('error_reporting', 0);
ini_set('display_errors', 0);
ini_set("log_errors", 0);

in following files:

  • default.php
  • login.php
  • admin/main.php
  • setup.php

and yep, Flatpress with patches is running.

Calendar

  • October 2019
    SunMonTueWedThuFriSat
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031 

Admin area

 

Top of Page