From 172b13b70a52e799ba55f7b3060a4a1b3d1ef178 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Mon, 11 Oct 2004 13:17:12 +0000 Subject: [PATCH] functions-compat.php shall hold PHP functions needed for PHP 4.1 compatibility git-svn-id: http://svn.automattic.com/wordpress/trunk@1776 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-compat.php | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 wp-includes/functions-compat.php diff --git a/wp-includes/functions-compat.php b/wp-includes/functions-compat.php new file mode 100644 index 000000000..7a17b0aa6 --- /dev/null +++ b/wp-includes/functions-compat.php @@ -0,0 +1,50 @@ + + if (get_class($object) == strtolower($class)) { + return true; + } else { + return is_subclass_of($object, $class); + } + } +} + +if (!function_exists('ob_clean')) { + function ob_clean() { + // by Aidan Lister + if (@ob_end_clean()) { + return ob_start(); + } + return false; + } +} + + +/* Added in PHP 4.3.0 */ + +function printr($var, $do_not_echo = false) { + // from php.net/print_r user contributed notes + ob_start(); + print_r($var); + $code = htmlentities(ob_get_contents()); + ob_clean(); + if (!$do_not_echo) { + echo "
$code
"; + } + return $code; +} + +?> \ No newline at end of file