|
@@ -438,6 +438,23 @@ function makeComposeLink($url, $text = null)
|
|
|
return makeInternalLink($url, $text, '_blank');
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+* sm_print_r($some_variable);
|
|
|
+* Debugging function - does the same as print_r, but makes sure special
|
|
|
+* characters are converted to htmlentities first. This will allow
|
|
|
+* values like <some@email.address> to be displayed.
|
|
|
+* The output is wrapped in <pre> and </pre> tags.
|
|
|
+*/
|
|
|
+function sm_print_r($var) {
|
|
|
+ ob_start(); // Buffer output
|
|
|
+ print_r($var);
|
|
|
+ $buffer = ob_get_contents(); // Grab the print_r output
|
|
|
+ ob_end_clean(); // Silently discard the output & stop buffering
|
|
|
+ print "<pre>";
|
|
|
+ print htmlentities($buffer);
|
|
|
+ print "</pre>";
|
|
|
+}
|
|
|
+
|
|
|
$PHP_SELF = php_self();
|
|
|
|
|
|
?>
|