SimplePortal

Development => Bugs => Topic started by: maisterk on August 23, 2018, 08:11:54 PM

Title: Help with this error
Post 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
Title: Re: Help with this error
Post by: Chen Zhen on August 24, 2018, 12:30:35 AM
[$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?
Title: Re: Help with this error
Post by: maisterk on August 24, 2018, 12:43:50 AM
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
Title: Re: Help with this error
Post by: 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: [Select]
function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;

add after the above code:
Code: [Select]
$page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);
Title: Re: Help with this error
Post by: maisterk on August 25, 2018, 02:45:14 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: [Select]
function sportal_get_pages($page_id = null, $active = false, $allowed = false)
{
global $smcFunc;
static $cache;

add after the above code:
Code: [Select]
$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.


Title: Re: Help with this error
Post by: Chen Zhen on August 25, 2018, 01:11:02 PM

File:
./Sources/PortalPages.php

find:
Code: [Select]
function sportal_pages()
{
global $smcFunc, $context, $scripturl;

loadTemplate('PortalPages');

$page_id = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;

add after the above code:
Code: [Select]
$page_id = is_array($page_id) ? preg_replace("/[^A-Za-z0-9_]/",'',implode($page_id)) : preg_replace("/[^A-Za-z0-9_]/",'',$page_id);
SimplePortal 2.3.8 © 2008-2024, SimplePortal