Skip to content

Wrong information on a comment of PostRepository: method sanitizeSearchQuery() #1023

@o-alquimista

Description

@o-alquimista

The DocBlock of sanitizeSearchQuery() says it is removing non-alphanumeric characters, while it seems to be only replacing duplicated spaces with a single space.

    /**
     * Removes all non-alphanumeric characters except whitespaces.
     */
    private function sanitizeSearchQuery(string $query): string
    {
        return trim(preg_replace('/[[:space:]]+/', ' ', $query));
    }

Someone forgot to implement the functionality? Or maybe forgot to remove the comment after the code it is about was removed.

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