aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-15 16:23:25 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-15 16:23:25 +0000
commit9cc5d6d7fcd4dd3a4a6bc6309e86cd83f751b355 (patch)
tree066886e94983bd677b93eb078b5cc584b2668d6f /engine/lib/database.php
parentbf88f65d3010b11d45ab991c427376e6bf10f19f (diff)
downloadelgg-9cc5d6d7fcd4dd3a4a6bc6309e86cd83f751b355.tar.gz
elgg-9cc5d6d7fcd4dd3a4a6bc6309e86cd83f751b355.tar.bz2
get_entities now allows for arrays of GUIDs to be supplied as an owner, and can be asked to count entities rather than return them; as a result, get_user_friends_objects and count_* functionality is also now available
git-svn-id: https://code.elgg.org/elgg/trunk@468 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 045f72c72..0979592c0 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -359,6 +359,38 @@
return mysql_real_escape_string(trim($string));
}
+ /**
+ * Wrapper function for Americans
+ *
+ * @param string $string The string to sanitise
+ * @return string Sanitised string
+ * @uses sanitise_string
+ */
+ function sanitize_string($string) {
+ return sanitise_string($string);
+ }
+
+ /**
+ * Sanitises an integer for database use
+ *
+ * @param int $int
+ * @return int Sanitised integer
+ */
+ function sanitise_int($int) {
+ return (int) $int;
+ }
+
+ /**
+ * Wrapper function for Americans
+ *
+ * @param int $int
+ * @return int Sanitised integer
+ * @uses sanitise_string
+ */
+ function sanitize_int($int) {
+ return (int) $int;
+ }
+
// Stuff for initialisation
register_event_handler('boot','system','init_db',0);