aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/template_processor.php4
-rw-r--r--include/text.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/include/template_processor.php b/include/template_processor.php
index 4c317efe1..46252c355 100644
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -13,12 +13,14 @@
var $debug=false;
private function _preg_error(){
+
switch(preg_last_error()){
case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
- case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
+// This is only valid for php > 5.3, not certain how to code around it for unit tests
+// case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
diff --git a/include/text.php b/include/text.php
index 29c781030..aced9e0a8 100644
--- a/include/text.php
+++ b/include/text.php
@@ -80,7 +80,7 @@ function escape_tags($string) {
if(! function_exists('autoname')) {
function autoname($len) {
- if(! $len)
+ if($len <= 0)
return '';
$vowels = array('a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u');