From 3cf979dd426e05937a8fda67f9ed3538b1edc50e Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 10 Oct 2007 22:11:18 +0000 Subject: [PATCH] Introducing absint() for casting to an absolute integer. see #4762 git-svn-id: https://develop.svn.wordpress.org/trunk@6222 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b33905501a..8b4a726b7c 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1432,4 +1432,13 @@ function require_wp_db() require_once (ABSPATH . WPINC . '/wp-db.php'); } +/** + * Converts input to an absolute integer + * @param mixed $maybeint data you wish to have convered to an absolute integer + * @return int an absolute integer + */ +function absint($maybeint) { + return abs(intval($maybeint)); +} + ?>