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

#2814 removing incorrect QueryBuilder#set() documentation, which was showing wrong password hashing and value binding practices (combo!) #2818

Merged
merged 1 commit into from
Aug 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Doctrine/DBAL/Query/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public function delete($delete = null, $alias = null)
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('users', 'u')
* ->set('u.password', md5('password'))
Copy link
Member

Choose a reason for hiding this comment

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

OH WOW, we had md5('password') in the docs?! Shame on us :-(

Copy link
Member

Choose a reason for hiding this comment

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

Oh, and no parameter binding: combo shame! :-\

* ->set('u.last_login', 'NOW()')
* ->where('u.id = ?');
* </code>
*
Expand Down Expand Up @@ -733,7 +733,7 @@ public function rightJoin($fromAlias, $join, $alias, $condition = null)
* <code>
* $qb = $conn->createQueryBuilder()
* ->update('users', 'u')
* ->set('u.password', md5('password'))
* ->set('u.last_login', 'NOW()')
* ->where('u.id = ?');
* </code>
*
Expand Down Expand Up @@ -765,7 +765,7 @@ public function set($key, $value)
* $or->add($qb->expr()->eq('u.id', 2));
*
* $qb->update('users', 'u')
* ->set('u.password', md5('password'))
* ->set('u.last_login', 'NOW()')
* ->where($or);
* </code>
*
Expand Down