Skip to content

modifyPath() potential issues #4

@mindplay-dk

Description

@mindplay-dk

This looks potentially dangerous:

$event->return = str_replace("{$this->subdomain}/", '', $event->return);

https://github.com/apeisa/Multisite/blob/master/Multisite.module#L74

A simple str_replace() will replace all occurrences of anything that looks like the sub-domain - I believe the correct thing to do here would be something along the lines of:

$event->return = substr($event->return, strlen($this->subdomain) + 1);

Also, I wonder, is Module::init() the right place to modify the $_GET['it'] superglobal? Aren't other modules (and the ProcessWire core itself) potentially initializing based on the "old" value prior to modification?

I'm vetting this module for use in a large multi-tenant site - have you used this module in production in a real multi-site scenario?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions