Skip to content

Block editing breaks the site with memory exhaustion when the user has uid = 1 #176

@walkero-gr

Description

@walkero-gr

There is a problem with the module when a user with uid = 1 tries to edit the blocks. The code goes into an infinite loop in the categories field and then gives 500 error with a message like below

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 32768 bytes) in /var/www/clients/client3/web60/web/class/logger/render.php on line 1, referer: https://www.amigans.net/modules/system/admin.php?fct=blocksadmin

I tracked it down to the following part of the code, which when I disabled it everything worked fine.
https://github.com/XoopsModules25x/publisher/blob/1.07_FINAL/class/CategoryHandler.php#L214-L216

My question is why this takes in consideration the uid and what is the purpose of this code. Because, as much as I understand it, this returns all the categories, no matter their level, and then the code that gets the subdomains loops indefinitely.

I noticed that this code is in the latest code in the master branch. Maybe that bug exists even in newer versions, which I haven't tested.

My test environment:
PHP 7.3
Xoops 2.5.10
Publisher 1.07 FINAL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions