Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Recommendation #4

@crazedVic

Description

@crazedVic

I would recommend adding self::_getPDO()->quote($where) to the following function. This will prevent characters like ' from making the query invalid.

public static function where($where, $params = [], $order = null, $limit = null, $index = 0)
    {
        if ($where === '') {
            $query = 'SELECT * FROM `' . self::getTable() . '` ' . self::order($order) . self::limit($limit, $index);
        } else {
            $query = 'SELECT * FROM `' . self::getTable() . '` WHERE ' . self::_getPDO()->quote($where) . self::order($order) . self::limit($limit, $index);
        }
        return self::query($query, $params);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions