From 96abdb996a93338f9bcd47627ace99802d3ac8fb Mon Sep 17 00:00:00 2001 From: abraar Date: Fri, 10 Dec 2010 14:09:28 +0000 Subject: [PATCH] Replaced eregi() with preg_match() and get_class() for thirdparty --- gulliver/system/class.form.php | 2 +- .../classes/org/active-link/xml/XML.php | 20 +++++++++---------- .../classes/org/active-link/xml/XMLBranch.php | 2 +- .../classes/org/active-link/xml/XMLLeaf.php | 2 +- .../fpdf/font/makefont/makefont.php | 6 +++--- .../html2ps_pdf/pdf.fpdf.makefont.php | 2 +- .../html2ps_pdf/tree.navigation.inc.php | 2 +- gulliver/thirdparty/pear/OS/Guess.php | 2 +- gulliver/thirdparty/pear/PEAR/Registry.php | 2 +- .../pear/Spreadsheet/Excel/Writer/Parser.php | 7 ++++--- gulliver/thirdparty/pear/XML/Parser.php | 4 ++-- .../thirdparty/pear/class.soap_server.php | 8 ++++---- gulliver/thirdparty/pear/class.soapclient.php | 2 +- gulliver/thirdparty/pear/nusoap.colosa.php | 12 +++++------ gulliver/thirdparty/pear/nusoap.php | 10 +++++----- rbac/engine/classes/model/RbacUsers.php | 8 ++++---- rbac/engine/classes/model/Systems.php | 4 ++-- workflow/engine/classes/model/AppMessage.php | 2 +- .../engine/classes/model/UsersProperties.php | 2 -- workflow/engine/skins/rtl.cnf | 2 +- 20 files changed, 50 insertions(+), 51 deletions(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index d13d045e0..bf303357d 100644 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -233,7 +233,7 @@ class Form extends XmlForm } } foreach($this->fields as $k => $v){ - if(is_object($this) && get_class($this->fields[$k])!='__PHP_Incomplete_Class'){ + if(is_object($this->fields[$k]) && get_class($this->fields[$k])!='__PHP_Incomplete_Class'){ $this->fields[$k]->owner =& $this; } } diff --git a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XML.php b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XML.php index 34a0c494f..55447d871 100644 --- a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XML.php +++ b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XML.php @@ -228,7 +228,7 @@ class XML_ extends Tree { } else { foreach($this->nodes as $node) { - if(strtolower(get_class($node)) == "xmlbranch") + if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") if($node->tag->getTagName() == $tags[1]) { $newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $attributeValue = $node->getTagAttribute($attributeName, $newTagPath); @@ -255,7 +255,7 @@ class XML_ extends Tree { $tagValue = $this->getXMLContent(); else { foreach($this->nodes as $node) { - if(strtolower(get_class($node)) == "xmlbranch") + if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") if($node->tag->getTagName() == $tags[1]) { $newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $tagValue = $node->getTagContent($newTagPath); @@ -337,7 +337,7 @@ class XML_ extends Tree { function hasBranch() { $hasBranch = false; foreach($this->nodes as $node) { - if(strtolower(get_class($node)) == "xmlbranch") { + if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") { $hasBranch = true; break; } @@ -353,7 +353,7 @@ class XML_ extends Tree { function hasLeaf() { $hasLeaf = false; foreach($this->nodes as $node) { - if(strtolower(get_class($node)) == "xmlleaf") { + if(is_object($node) && strtolower(get_class($node)) == "xmlleaf") { $hasLeaf = true; break; } @@ -407,7 +407,7 @@ class XML_ extends Tree { */ function removeAllBranches() { foreach($this->nodes as $key => $value) { - if(strtolower(get_class($value)) == "xmlbranch") + if(is_object($value) && strtolower(get_class($value)) == "xmlbranch") unset($this->nodes[$key]); } } @@ -418,7 +418,7 @@ class XML_ extends Tree { */ function removeAllLeafs() { foreach($this->nodes as $key => $value) { - if(strtolower(get_class($value)) == "xmlleaf") + if(is_object($value) && strtolower(get_class($value)) == "xmlleaf") unset($this->nodes[$key]); } } @@ -469,7 +469,7 @@ class XML_ extends Tree { */ function setBranchTag($branchId, $tag) { $success = true; - if(strtolower(get_class($this->nodes[$branchId])) == "xmlbranch" && strtolower(get_class($tag)) == "tag") + if(is_object($this->nodes[$branchId]) && (strtolower(get_class($this->nodes[$branchId])) == "xmlbranch" && strtolower(get_class($tag)) == "tag")) $this->nodes[$branchId]->setTag($tag); else $success = false; @@ -484,7 +484,7 @@ class XML_ extends Tree { */ function setTag($tag) { $success = true; - if(strtolower(get_class($tag)) == "tag") + if(is_object($tag) && strtolower(get_class($tag)) == "tag") $this->tag = $tag; else $success = false; @@ -513,7 +513,7 @@ class XML_ extends Tree { $arrKeys = array_keys($this->nodes); for($index = 0; $index < count($arrKeys); $index ++) { $node =& $this->nodes[$arrKeys[$index]]; - if(strtolower(get_class($node)) == "xmlbranch") + if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") if($node->tag->getTagName() == $tags[1]) { $newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $success = $node->setTagAttribute($attributeName, $attributeValue, $newTagPath); @@ -553,7 +553,7 @@ class XML_ extends Tree { $arrKeys = array_keys($this->nodes); for($index = 0; $index < count($arrKeys); $index ++) { $node =& $this->nodes[$arrKeys[$index]]; - if(strtolower(get_class($node)) == "xmlbranch") + if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") if($node->tag->getTagName() == $tags[1]) { $newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $success = $node->setTagContent($content, $newTagPath); diff --git a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLBranch.php b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLBranch.php index 9e3777a07..d3653e703 100644 --- a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLBranch.php +++ b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLBranch.php @@ -59,7 +59,7 @@ class XMLBranch extends XML_ { */ function setParentXML(&$xml) { $success = false; - if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") { + if(is_object($xml) == "xml" && (strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch")) { $this->parentXML = &$xml; $success = true; } diff --git a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLLeaf.php b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLLeaf.php index 02acb1af3..78a9e2a2d 100644 --- a/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLLeaf.php +++ b/gulliver/thirdparty/html2ps_pdf/classes/org/active-link/xml/XMLLeaf.php @@ -61,7 +61,7 @@ class XMLLeaf extends Leaf { */ function setParentXML(&$xml) { $success = false; - if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") { + if((is_object($xml) == "xml" && strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch")) { $this->parentXML = &$xml; $success = true; } diff --git a/gulliver/thirdparty/html2ps_pdf/fpdf/font/makefont/makefont.php b/gulliver/thirdparty/html2ps_pdf/fpdf/font/makefont/makefont.php index 290cb907e..19d8e5a59 100644 --- a/gulliver/thirdparty/html2ps_pdf/fpdf/font/makefont/makefont.php +++ b/gulliver/thirdparty/html2ps_pdf/fpdf/font/makefont/makefont.php @@ -171,7 +171,7 @@ function MakeFontDescriptor($fm,$symbolic) //StemV if(isset($fm['StdVW'])) $stemv=$fm['StdVW']; - elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight'])) + elseif(isset($fm['Weight']) and preg_match('/(bold|black)/',$fm['Weight'])) $stemv=120; else $stemv=70; @@ -289,9 +289,9 @@ function CheckTTF($file) } /******************************************************************************* - * $fontfile : chemin du fichier TTF (ou chaîne vide si pas d'incorporation) * + * $fontfile : chemin du fichier TTF (ou cha�ne vide si pas d'incorporation) * * $afmfile : chemin du fichier AFM * - * $enc : encodage (ou chaîne vide si la police est symbolique) * + * $enc : encodage (ou cha�ne vide si la police est symbolique) * * $patch : patch optionnel pour l'encodage * * $type : type de la police si $fontfile est vide * *******************************************************************************/ diff --git a/gulliver/thirdparty/html2ps_pdf/pdf.fpdf.makefont.php b/gulliver/thirdparty/html2ps_pdf/pdf.fpdf.makefont.php index 3e6a5d18a..fc4c4fb79 100644 --- a/gulliver/thirdparty/html2ps_pdf/pdf.fpdf.makefont.php +++ b/gulliver/thirdparty/html2ps_pdf/pdf.fpdf.makefont.php @@ -234,7 +234,7 @@ function MakeFontDescriptor($fm,$symbolic) { //StemV if (isset($fm['StdVW'])) { $stemv=$fm['StdVW']; - } elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight'])) { + } elseif(isset($fm['Weight']) and preg_match('/(bold|black)/',$fm['Weight'])) { $stemv=120; } else { $stemv=70; diff --git a/gulliver/thirdparty/html2ps_pdf/tree.navigation.inc.php b/gulliver/thirdparty/html2ps_pdf/tree.navigation.inc.php index 9ab6e553d..91b184d80 100644 --- a/gulliver/thirdparty/html2ps_pdf/tree.navigation.inc.php +++ b/gulliver/thirdparty/html2ps_pdf/tree.navigation.inc.php @@ -37,7 +37,7 @@ function &traverse_dom_tree_pdf(&$root) { function dump_tree(&$box, $level) { print(str_repeat(" ", $level)); - print(get_class($box).":".$box->uid."\n"); + print(is_object($box) && get_class($box).":".$box->uid."\n"); if (isset($box->content)) { for ($i=0; $icontent); $i++) { diff --git a/gulliver/thirdparty/pear/OS/Guess.php b/gulliver/thirdparty/pear/OS/Guess.php index 42d7391a7..5decdc896 100644 --- a/gulliver/thirdparty/pear/OS/Guess.php +++ b/gulliver/thirdparty/pear/OS/Guess.php @@ -249,7 +249,7 @@ class OS_Guess { if (strcspn($fragment, '*?') < strlen($fragment)) { $reg = '^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '$'; - return eregi($reg, $value); + return preg_match($reg, $value); } return ($fragment == '*' || !strcasecmp($fragment, $value)); } diff --git a/gulliver/thirdparty/pear/PEAR/Registry.php b/gulliver/thirdparty/pear/PEAR/Registry.php index 1fb1bc0b0..0e7849327 100644 --- a/gulliver/thirdparty/pear/PEAR/Registry.php +++ b/gulliver/thirdparty/pear/PEAR/Registry.php @@ -254,7 +254,7 @@ class PEAR_Registry extends PEAR */ function _lock($mode = LOCK_EX) { - if (!eregi('Windows 9', php_uname())) { + if (!preg_match('/Windows 9/', php_uname())) { if ($mode != LOCK_UN && is_resource($this->lock_fp)) { // XXX does not check type of lock (LOCK_SH/LOCK_EX) return true; diff --git a/gulliver/thirdparty/pear/Spreadsheet/Excel/Writer/Parser.php b/gulliver/thirdparty/pear/Spreadsheet/Excel/Writer/Parser.php index 9e5866cb8..e617de750 100644 --- a/gulliver/thirdparty/pear/Spreadsheet/Excel/Writer/Parser.php +++ b/gulliver/thirdparty/pear/Spreadsheet/Excel/Writer/Parser.php @@ -1300,12 +1300,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $token; } // If it's a string (of maximum 255 characters) - elseif (ereg("^\"[^\"]{0,255}\"$",$token)) + //elseif (ereg("^\"[^\"]{0,255}\"$",$token)) + elseif (preg_match("/{0,255}/",$token)) { return $token; } // if it's a function call - elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$token) and ($this->_lookahead == "(")) + elseif (preg_match("/[A-Z0-9\xc0-\xdc\.]/",$token) and ($this->_lookahead == "(")) { return $token; } @@ -1582,7 +1583,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR return $result; } // if it's a function call - elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token)) + elseif (preg_match("/[A-Z0-9\xc0-\xdc\.]/",$this->_current_token)) { $result = $this->_func(); return $result; diff --git a/gulliver/thirdparty/pear/XML/Parser.php b/gulliver/thirdparty/pear/XML/Parser.php index 737fedc61..664008b01 100644 --- a/gulliver/thirdparty/pear/XML/Parser.php +++ b/gulliver/thirdparty/pear/XML/Parser.php @@ -376,7 +376,7 @@ class XML_Parser extends PEAR /** * check, if file is a remote file */ - if (eregi('^(http|ftp)://', substr($file, 0, 10))) { + if (preg_match('/(http|ftp):///', substr($file, 0, 10))) { if (!ini_get('allow_url_fopen')) { return $this->raiseError('Remote files cannot be parsed, as safe mode is enabled.', XML_PARSER_ERROR_REMOTE); } @@ -429,7 +429,7 @@ class XML_Parser extends PEAR return true; } // see if it's an absolute URL (has a scheme at the beginning) - elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) { + elseif (preg_match('/[a-z]+:///', substr($fp, 0, 10))) { return $this->setInputFile($fp); } // see if it's a local file diff --git a/gulliver/thirdparty/pear/class.soap_server.php b/gulliver/thirdparty/pear/class.soap_server.php index b4e976424..21ce9cd40 100644 --- a/gulliver/thirdparty/pear/class.soap_server.php +++ b/gulliver/thirdparty/pear/class.soap_server.php @@ -311,7 +311,7 @@ class soap_server extends nusoap_base { // get the character encoding of the incoming request if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -340,7 +340,7 @@ class soap_server extends nusoap_base { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -374,7 +374,7 @@ class soap_server extends nusoap_base { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -791,7 +791,7 @@ class soap_server extends nusoap_base { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; diff --git a/gulliver/thirdparty/pear/class.soapclient.php b/gulliver/thirdparty/pear/class.soapclient.php index 55979d2ae..e1bf899a3 100644 --- a/gulliver/thirdparty/pear/class.soapclient.php +++ b/gulliver/thirdparty/pear/class.soapclient.php @@ -442,7 +442,7 @@ class soapclient extends nusoap_base { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; diff --git a/gulliver/thirdparty/pear/nusoap.colosa.php b/gulliver/thirdparty/pear/nusoap.colosa.php index 3a5ee0eff..500ecdaff 100644 --- a/gulliver/thirdparty/pear/nusoap.colosa.php +++ b/gulliver/thirdparty/pear/nusoap.colosa.php @@ -3340,7 +3340,7 @@ class soap_server_colosa extends nusoap_base_colosa { // get the character encoding of the incoming request if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3369,7 +3369,7 @@ class soap_server_colosa extends nusoap_base_colosa { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3403,7 +3403,7 @@ class soap_server_colosa extends nusoap_base_colosa { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3629,7 +3629,7 @@ class soap_server_colosa extends nusoap_base_colosa { function serialize_return() { $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI); // if fault - if (isset($this->methodreturn) && (get_class($this->methodreturn) == 'soap_fault_colosa')) { + if (isset($this->methodreturn) && (is_object($this->methodreturn) && get_class($this->methodreturn) == 'soap_fault_colosa')) { $this->debug('got a fault object from method'); $this->fault = $this->methodreturn; return; @@ -3820,7 +3820,7 @@ class soap_server_colosa extends nusoap_base_colosa { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -6832,7 +6832,7 @@ class soapclient_colosa extends nusoap_base_colosa { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; diff --git a/gulliver/thirdparty/pear/nusoap.php b/gulliver/thirdparty/pear/nusoap.php index 228f05991..7fc5426e0 100644 --- a/gulliver/thirdparty/pear/nusoap.php +++ b/gulliver/thirdparty/pear/nusoap.php @@ -3343,7 +3343,7 @@ class soap_server extends nusoap_base { // get the character encoding of the incoming request if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3372,7 +3372,7 @@ class soap_server extends nusoap_base { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3406,7 +3406,7 @@ class soap_server extends nusoap_base { $enc = substr(strstr($v, '='), 1); $enc = str_replace('"', '', $enc); $enc = str_replace('\\', '', $enc); - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) { + if (preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/', $enc)) { $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -3823,7 +3823,7 @@ class soap_server extends nusoap_base { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; @@ -6829,7 +6829,7 @@ class soapclient extends nusoap_base { if (strpos($headers['content-type'], '=')) { $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $this->debug('Got response encoding: ' . $enc); - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){ + if(preg_match('/(ISO-8859-1|US-ASCII|UTF-8)/',$enc)){ $this->xml_encoding = strtoupper($enc); } else { $this->xml_encoding = 'US-ASCII'; diff --git a/rbac/engine/classes/model/RbacUsers.php b/rbac/engine/classes/model/RbacUsers.php index 3066e1181..db5e9f9f2 100644 --- a/rbac/engine/classes/model/RbacUsers.php +++ b/rbac/engine/classes/model/RbacUsers.php @@ -68,7 +68,7 @@ class RbacUsers extends BaseRbacUsers { $c = new Criteria( 'rbac' ); $c->add ( RbacUsersPeer::USR_USERNAME, $sUsername ); $rs = RbacUsersPeer::doSelect( $c ); - if ( is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'RbacUsers' ) { + if ( is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'RbacUsers' ) { $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME); //verify password with md5, and md5 format //if ( $aFields['USR_PASSWORD'] == md5 ($sPassword ) ) { @@ -101,7 +101,7 @@ class RbacUsers extends BaseRbacUsers { $c = new Criteria( 'rbac' ); $c->add ( RbacUsersPeer::USR_USERNAME, $sUsername ); $rs = RbacUsersPeer::doSelect( $c ); - if (is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'RbacUsers') + if (is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'RbacUsers') { //return the row for futher check of which Autentificacion method belongs this user $this->fields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);; @@ -126,7 +126,7 @@ class RbacUsers extends BaseRbacUsers { $c = new Criteria( 'rbac' ); $c->add ( RbacUsersPeer::USR_UID, $sUserId ); $rs = RbacUsersPeer::doSelect( $c ); - if (is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'RbacUsers') + if (is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'RbacUsers') { return 1; } @@ -147,7 +147,7 @@ class RbacUsers extends BaseRbacUsers { $c = new Criteria( 'rbac' ); $c->add ( RbacUsersPeer::USR_UID, $sUsrUid ); $rs = RbacUsersPeer::doSelect( $c ); - if ( is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'RbacUsers' ) { + if ( is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'RbacUsers' ) { $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME); return $aFields; } diff --git a/rbac/engine/classes/model/Systems.php b/rbac/engine/classes/model/Systems.php index 62e7738f2..e9e1c7c3a 100644 --- a/rbac/engine/classes/model/Systems.php +++ b/rbac/engine/classes/model/Systems.php @@ -70,7 +70,7 @@ class Systems extends BaseSystems { $c = new Criteria( 'rbac' ); $c->add ( SystemsPeer::SYS_CODE, $SysUid ); $rs = SystemsPeer::doSelect( $c ); - if ( is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'Systems' ) { + if ( is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'Systems' ) { $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME); $this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME ); return $aFields; @@ -91,7 +91,7 @@ class Systems extends BaseSystems { $c = new Criteria( 'rbac' ); $c->add ( SystemsPeer::SYS_CODE, $SysUid ); $rs = SystemsPeer::doSelect( $c ); - $exists = ( is_array($rs) && isset( $rs[0] ) && get_class ( $rs[0] ) == 'Systems' ); + $exists = ( is_array($rs) && isset( $rs[0] ) && is_object($rs[0]) && get_class ( $rs[0] ) == 'Systems' ); if ( $exists ) return; diff --git a/workflow/engine/classes/model/AppMessage.php b/workflow/engine/classes/model/AppMessage.php index 5ed66fa79..9017950f4 100644 --- a/workflow/engine/classes/model/AppMessage.php +++ b/workflow/engine/classes/model/AppMessage.php @@ -104,7 +104,7 @@ class AppMessage extends BaseAppMessage { if(isset($aData['app_msg_uid'])) { $o = EmployeePeer::retrieveByPk($aData['app_msg_uid']); } - if (isset($o) && get_class($o) == 'AppMessage') { + if (isset($o) && is_object($o)&& get_class($o) == 'AppMessage') { $o->fromArray($aData, BasePeer::TYPE_FIELDNAME); $o->setAppMsgDate(date('Y-m-d H:i:s')); $o->save(); diff --git a/workflow/engine/classes/model/UsersProperties.php b/workflow/engine/classes/model/UsersProperties.php index 632204b5b..44db872ec 100644 --- a/workflow/engine/classes/model/UsersProperties.php +++ b/workflow/engine/classes/model/UsersProperties.php @@ -18,8 +18,6 @@ class UsersProperties extends BaseUsersProperties { function UserPropertyExists($sUserUID) { try { $oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID); - var_dump($oUserProperty); - var_dump($sUserUID); if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') { echo"inside"; return true; diff --git a/workflow/engine/skins/rtl.cnf b/workflow/engine/skins/rtl.cnf index e404b8506..85217cf14 100644 --- a/workflow/engine/skins/rtl.cnf +++ b/workflow/engine/skins/rtl.cnf @@ -1 +1 @@ -O:8:"stdClass":3:{s:4:"name";s:3:"rtl";s:11:"description";s:40:"Skin for Right-To-Left languages (Hebrew, Arabic, etc.)";s:7:"version";i:1;} \ No newline at end of file +O:8:"stdClass":3:{s:4:"name";s:3:"rtl";s:11:"description";s:24:"description of skin rtl ";s:7:"version";i:2;} \ No newline at end of file