1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

PHP8 Fix for search.php . e_HTTP fix for CLI mode.

This commit is contained in:
Cameron 2021-01-13 11:20:58 -08:00
parent b6f9b831ca
commit ca471b31db
3 changed files with 17 additions and 1 deletions

View File

@ -3782,6 +3782,11 @@ class e107
/* backward compat - core keys. ie. news/xxx/xxx user/xxx/xxx etc, */
$legacy = array('news', 'page', 'search', 'user', 'download', 'gallery');
if($plugin === 'search')
{
$plugin = 'search/index';
}
if (strpos($plugin, '/') !== false)
{
$tmp = explode("/", $plugin, 2);
@ -3869,6 +3874,7 @@ class e107
if (empty($sefActive[$plugin])) // SEF disabled.
{
self::getDebug()->log('SEF URL for <b>' . $plugin . '</b> disabled.');
trigger_error('SEF URL for <b>' . $plugin . '</b> disabled.', E_USER_NOTICE);
$active = false;
}
@ -4559,6 +4565,7 @@ class e107
if(self::isCli()) // Maintain relative path consistency in CLI mode
{
chdir(e_ROOT);
define('e_HTTP', '/'); // fixes generate URLs by not using $this->server_path
}
$path = dirname(self::getRelativePath(getcwd(), $target_path)) . "/";

View File

@ -5524,12 +5524,20 @@ return;
private function grantScriptAccess()
{
$this->allowedTags = array_merge($this->allowedTags, $this->scriptTags);
if(!in_array('script', $this->allowedTags))
{
$this->allowedTags = array_merge($this->allowedTags, $this->scriptTags);
}
foreach($this->allowedAttributes as $tag => $att)
{
foreach($this->scriptAttributes as $new)
{
if(in_array($new, $this->allowedAttributes[$tag]))
{
continue;
}
$this->allowedAttributes[$tag][] = $new;
}
}

View File

@ -61,6 +61,7 @@ class search extends e_shortcode
'ep' => LAN_SEARCH_26,
'be' => LAN_SEARCH_27
);
private $searchtype;
function __construct()
{