]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Escape query parameters in Profile_tag::getTagged()
authorJoshua Wise <jwise@nvidia.com>
Tue, 16 Jul 2013 17:35:44 +0000 (10:35 -0700)
committerEvan Prodromou <evan@e14n.com>
Tue, 16 Jul 2013 17:35:44 +0000 (10:35 -0700)
This patch escapes query parameters in Profile_tag::getTagged(). This
is an extra security step; since these parameters come out of the
database, it's unlikely that they would have dangerous data in them.

classes/Profile_tag.php

index fdac14cd7163e004d03f530d472c95734bae0a67..75cca8c22c364e169967a41d749fb19566036391 100644 (file)
@@ -310,8 +310,8 @@ class Profile_tag extends Managed_DataObject
         $profile->query('SELECT profile.* ' .
                         'FROM profile JOIN profile_tag ' .
                         'ON profile.id = profile_tag.tagged ' .
-                        'WHERE profile_tag.tagger = ' . $tagger . ' ' .
-                        'AND profile_tag.tag = "' . $tag . '" ');
+                        'WHERE profile_tag.tagger = ' . $profile->escape($tagger) . ' ' .
+                        'AND profile_tag.tag = "' . $profile->escape($tag) . '" ');
         $tagged = array();
         while ($profile->fetch()) {
             $tagged[] = clone($profile);