mirror of
https://github.com/e107inc/e107.git
synced 2025-07-15 03:56:20 +02:00
PHP8 Fix for search.php . e_HTTP fix for CLI mode.
This commit is contained in:
@ -3782,6 +3782,11 @@ class e107
|
|||||||
/* backward compat - core keys. ie. news/xxx/xxx user/xxx/xxx etc, */
|
/* backward compat - core keys. ie. news/xxx/xxx user/xxx/xxx etc, */
|
||||||
$legacy = array('news', 'page', 'search', 'user', 'download', 'gallery');
|
$legacy = array('news', 'page', 'search', 'user', 'download', 'gallery');
|
||||||
|
|
||||||
|
if($plugin === 'search')
|
||||||
|
{
|
||||||
|
$plugin = 'search/index';
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($plugin, '/') !== false)
|
if (strpos($plugin, '/') !== false)
|
||||||
{
|
{
|
||||||
$tmp = explode("/", $plugin, 2);
|
$tmp = explode("/", $plugin, 2);
|
||||||
@ -3869,6 +3874,7 @@ class e107
|
|||||||
if (empty($sefActive[$plugin])) // SEF disabled.
|
if (empty($sefActive[$plugin])) // SEF disabled.
|
||||||
{
|
{
|
||||||
self::getDebug()->log('SEF URL for <b>' . $plugin . '</b> 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;
|
$active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4559,6 +4565,7 @@ class e107
|
|||||||
if(self::isCli()) // Maintain relative path consistency in CLI mode
|
if(self::isCli()) // Maintain relative path consistency in CLI mode
|
||||||
{
|
{
|
||||||
chdir(e_ROOT);
|
chdir(e_ROOT);
|
||||||
|
define('e_HTTP', '/'); // fixes generate URLs by not using $this->server_path
|
||||||
}
|
}
|
||||||
|
|
||||||
$path = dirname(self::getRelativePath(getcwd(), $target_path)) . "/";
|
$path = dirname(self::getRelativePath(getcwd(), $target_path)) . "/";
|
||||||
|
@ -5524,12 +5524,20 @@ return;
|
|||||||
|
|
||||||
private function grantScriptAccess()
|
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->allowedAttributes as $tag => $att)
|
||||||
{
|
{
|
||||||
foreach($this->scriptAttributes as $new)
|
foreach($this->scriptAttributes as $new)
|
||||||
{
|
{
|
||||||
|
if(in_array($new, $this->allowedAttributes[$tag]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->allowedAttributes[$tag][] = $new;
|
$this->allowedAttributes[$tag][] = $new;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ class search extends e_shortcode
|
|||||||
'ep' => LAN_SEARCH_26,
|
'ep' => LAN_SEARCH_26,
|
||||||
'be' => LAN_SEARCH_27
|
'be' => LAN_SEARCH_27
|
||||||
);
|
);
|
||||||
|
private $searchtype;
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user