1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

PHP8 Compatibility and code cleanup.

This commit is contained in:
Cameron
2020-12-08 12:21:12 -08:00
parent a094a8fb73
commit afaac88003
49 changed files with 264 additions and 225 deletions

View File

@@ -119,8 +119,10 @@ $config = varset($_GET['config'],false); // e_QUERY;
$gen = $wy->renderConfig($config);
define('USE_GZIP', true);
$compression_browser_support = false;
$compression_server_support = false;
if(strstr(varset($_SERVER['HTTP_ACCEPT_ENCODING'], ''), 'gzip'))
if(strstr(varset($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip'))
{
$compression_browser_support = true;
}
@@ -143,16 +145,19 @@ if(ADMIN && e_QUERY == 'debug' || !empty($_GET['debug']))
</td>
</tr></table>";
echo "<br />Browser gZip support: ".$compression_browser_support;
echo "<br />Server gZip support: ". $compression_server_support;
// echo "<br />Browser gZip support: ".$compression_browser_support;
// echo "<br />Server gZip support: ". $compression_server_support;
require_once(FOOTERF);
}
elseif((USE_GZIP === true) && $compression_browser_support && $compression_server_support)
{
while (@ob_end_clean()); // clear out anything that may have been echoed from class2.php or theme
header('Content-type: text/javascript;charset=UTF-8', true);
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
header('Content-type: text/javascript;charset=UTF-8');
header('Content-Encoding: gzip');
$minified = e107::minify($gen);
@@ -163,7 +168,10 @@ elseif((USE_GZIP === true) && $compression_browser_support && $compression_serve
}
else
{
while (@ob_end_clean()); // clear out anything that may have been echoed from class2.php or theme.
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
ob_start();
ob_implicit_flush(0);
header('Content-type: text/javascript', TRUE);
@@ -180,9 +188,9 @@ exit;
class wysiwyg
{
var $js;
var $config = array();
var $configName;
public $js;
public $config = array();
public $configName;
function renderConfig($config='')
{
@@ -199,7 +207,7 @@ class wysiwyg
},\n";
*/
$text .= $this->config; // Moc: temporary fix for BC with PHP 5.3: https://github.com/e107inc/e107/issues/614
// $text .= $this->config; // Moc: temporary fix for BC with PHP 5.3: https://github.com/e107inc/e107/issues/614
$text .= "\n});";
@@ -329,7 +337,7 @@ class wysiwyg
{
if(empty($data))
{
return;
return null;
}
$tmp = explode(" ",$data);
@@ -396,7 +404,7 @@ class wysiwyg
function getConfig($config=false)
{
$tp = e107::getParser();
$fl = e107::getFile();
// $fl = e107::getFile();
if($config !== false)
{