Development > Bugs

Help with this error

(1/2) > >>

maisterk:

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

Chen Zhen:
[$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?

maisterk:
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

Chen Zhen:

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:

--- Code: ---function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;

--- End code ---

add after the above code:

--- Code: --- $page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);

--- End code ---

maisterk:

--- Quote from: Chen Zhen on August 24, 2018, 02:13:29 AM ---
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:

--- Code: ---function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;

--- End code ---

add after the above code:

--- Code: --- $page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);

--- End code ---


--- End quote ---

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.


Navigation

[0] Message Index

[#] Next page

Go to full version