SimplePortal
Development => Bugs => Topic started by: maisterk on August 23, 2018, 08:11:54 PM
-
What is this error
I found this errors on logs from several weeks ago:
forumurl/index.php?page[$kardi]=mipanel
8: Array to string conversion
Archivo: /var/www/Sources/Subs-Portal.php
LĂnea: 1092
Where "mipanel" is page of simpleportal and url changes in diferent errors
Is this error dangerous?
In the smf forums say it is simple portal related
Mods:
SMF 2.0.15
Simpleportal 2.3.7
Quickspoiler
thanks for reading :D
-
[$kardi] can't be used within a page name as your simple portal installation will not allow that by default.
Did you edit any of Simple Portal's files?
For example.. its language files?
-
In testing the error occurs using whatever is in square brackets
Ex
?page[asd]=page
?page[$Whatever]=page
I do not usually edit anything, I only use the portal to create pages
Except for the theme index template i think, but if i change to the default the error still occurs
My forum is in spanish_latin, but simpleportal is in english
-
It's nothing to worry about as it does not pose a security threat.
However this behavior should be filtered to not occur.
I will move this thread to the bug reports board.
Thank you for the report.
For now you can edit that Simple Portal file.
Edit:
./Sources/Subs-Portal.php
find:
function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;
add after the above code:
$page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);
-
It's nothing to worry about as it does not pose a security threat.
However this behavior should be filtered to not occur.
I will move this thread to the bug reports board.
Thank you for the report.
For now you can edit that Simple Portal file.
Edit:
./Sources/Subs-Portal.php
find:
function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;
add after the above code:
$page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);
With that code, the error occurs now in PortalPages.php line 51
If you say that the error is not dangerous, I will open my forum again, thanks.
-
File:
./Sources/PortalPages.php
find:
function sportal_pages()
{
global $smcFunc, $context, $scripturl;
loadTemplate('PortalPages');
$page_id = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;
add after the above code:
$page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);