Skip to content
Snippets Groups Projects
Commit 6589c60c authored by Andreas Gohr's avatar Andreas Gohr
Browse files

compatibility functions for missing ctype extension FS#2873

parent 9269d0b1
No related branches found
No related tags found
No related merge requests found
<?php
/**
* compatibility functions
*
* This file contains a few functions that might be missing from the PHP build
*/
if(!function_exists('ctype_space')) {
/**
* Check for whitespace character(s)
*
* @see ctype_space
* @param string $text
* @return bool
*/
function ctype_space($text) {
if(!is_string($text)) return false; #FIXME original treats between -128 and 255 inclusive as ASCII chars
if(trim($text) === '') return true;
return false;
}
}
if(!function_exists('ctype_digit')) {
/**
* Check for numeric character(s)
*
* @see ctype_digit
* @param string $text
* @return bool
*/
function ctype_digit($text) {
if(!is_string($text)) return false; #FIXME original treats between -128 and 255 inclusive as ASCII chars
if(preg_match('/^\d+$/', $text)) return true;
return false;
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ require_once(DOKU_INC.'inc/template.php');
require_once(DOKU_INC.'inc/toolbar.php');
require_once(DOKU_INC.'inc/utf8.php');
require_once(DOKU_INC.'inc/auth.php');
require_once(DOKU_INC.'inc/compatibility.php');
/**
* spl_autoload_register callback
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment