Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] Optimized get by UUID #14633

Merged
merged 2 commits into from Mar 15, 2023
Merged

[Task] Optimized get by UUID #14633

merged 2 commits into from Mar 15, 2023

Conversation

lukmzig
Copy link
Contributor

@lukmzig lukmzig commented Mar 13, 2023

No description provided.

@lukmzig lukmzig added the Task label Mar 13, 2023
@lukmzig lukmzig added this to the 10.5.19 milestone Mar 13, 2023
@github-actions
Copy link

Review Checklist

  • Target branch (10.5 for bug fixes, others 11.x)
  • Tests (if it's testable code, there should be a test for it - get help)
  • Docs (every functionality needs to be documented, see here)
  • Migration incl. install.sql (e.g. if the database schema changes, ...)
  • Upgrade notes (deprecations, important information, migration hints, ...)
  • Label
  • Milestone

@@ -80,7 +80,7 @@ public function delete()
*/
public function getByUuid($uuid)
{
$data = $this->db->fetchAssociative('SELECT * FROM ' . self::TABLE_NAME ." where uuid='" . $uuid . "'");
$data = $this->db->fetchAssociative('SELECT * FROM ' . self::TABLE_NAME . ' where uuid= ?', [$uuid]);
Copy link
Contributor

@NiklasBr NiklasBr Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest supplying the third param with a type instead [Types::STRING] if you must:

https://www.doctrine-project.org/projects/doctrine-dbal/en/2.13/reference/security.html#security

Besides binding parameters you can also pass the type of the variable. This allows Doctrine or the underlying vendor to not only escape but also cast the value to the correct type.

@robertSt7 robertSt7 merged commit 08e7ba5 into 10.5 Mar 15, 2023
11 checks passed
@robertSt7 robertSt7 deleted the uuid_list branch March 15, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants