]> git.ipfire.org Git - thirdparty/bugzilla.git/commit
[Bug 1592129] Add a shortcut for quoting identifiers in strings.
authorDylan William Hardison <dylan@hardison.net>
Sat, 1 Feb 2020 15:39:08 +0000 (16:39 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2020 15:39:08 +0000 (16:39 +0100)
commit35210c061e2ef7831624eafbc69cdbae08dc3d57
treeede99bbd664a22a82e6054e00cb7ad5a3f7c852a
parente2665f84855f634981dc2372dd8d12614ced7a21
 [Bug 1592129] Add a shortcut for quoting identifiers in strings.

The Bugzilla::DB object has a qi attribute which returns a special hashref
that can be used inside double-quoted strings to quote database identifiers.

```perl
  my $q = Bugzilla->dbh->qi;
  Bugzilla->dbh->do("SELECT COUNT(*) FROM $q->{groups}");
```
Bugzilla/DB.pm
Bugzilla/DB/QuoteIdentifier.pm [new file with mode: 0644]