]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Escape SQL parameter in Profile_tag::moveTag()
authorJoshua Wise <jwise@nvidia.com>
Tue, 16 Jul 2013 17:27:30 +0000 (10:27 -0700)
committerEvan Prodromou <evan@e14n.com>
Tue, 16 Jul 2013 17:27:30 +0000 (10:27 -0700)
This change adds additional escapes for arguments to
Profile_tag::moveTag(). The arguments are canonicalized in the API and
Web UI paths higher up the stack, but this change makes sure that no
other paths can introduce SQL injection errors.

classes/Profile_tag.php

index de91857eb878dc66eef896222b76f16495705259..fdac14cd7163e004d03f530d472c95734bae0a67 100644 (file)
@@ -284,8 +284,11 @@ class Profile_tag extends Managed_DataObject
                'tag = "%s", tagger = "%s" ' .
                'WHERE tag = "%s" ' .
                'AND tagger = "%s"';
-        $result = $tags->query(sprintf($qry, $new->tag, $new->tagger,
-                                             $orig->tag, $orig->tagger));
+        $result = $tags->query(sprintf($qry,
+                                       $tags->escape($new->tag),
+                                       $tags->escape($new->tagger),
+                                       $tags->escape($orig->tag),
+                                       $tags->escape($orig->tagger)));
 
         if (!$result) {
             common_log_db_error($tags, 'UPDATE', __FILE__);