Skip to content
Extraits de code Groupes Projets
Valider db55a5b4 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

users can use any id in query (like an auto -a)

parent 4069ffbe
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -80,7 +80,12 @@ sub _get_from_offset { ...@@ -80,7 +80,12 @@ sub _get_from_offset {
sub _test_if_exists { sub _test_if_exists {
my ($index, $chan) = @_; my ($index, $chan) = @_;
my $sth = $dbh->prepare(' my $sth;
# in query, we don't check chan
# this means that a user can indicate any id in query
if ($chan =~ /^#/) {
$sth = $dbh->prepare('
SELECT content SELECT content
FROM playbot_chan FROM playbot_chan
WHERE content = ? WHERE content = ?
...@@ -88,6 +93,20 @@ sub _test_if_exists { ...@@ -88,6 +93,20 @@ sub _test_if_exists {
LIMIT 1 LIMIT 1
'); ');
$sth->execute($index, $chan)
or $log->error("Couldn't finish transaction: " . $dbh->errstr);
} else {
$sth = $dbh->prepare('
SELECT content
FROM playbot_chan
WHERE content = ?
LIMIT 1
');
$sth->execute($index)
or $log->error("Couldn't finish transaction: " . $dbh->errstr);
}
$sth->execute($index, $chan) $sth->execute($index, $chan)
or $log->error("Couldn't finish transaction: " . $dbh->errstr); or $log->error("Couldn't finish transaction: " . $dbh->errstr);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter