From c23352bedfdc4382a21c0d8e8794f22d2177d049 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 10 Oct 2007 22:11:18 +0000 Subject: [PATCH] Introducing absint() for casting to an absolute integer. see #4762 git-svn-id: http://svn.automattic.com/wordpress/trunk@6222 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b33905501..8b4a726b7 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)); +} + ?>