Replaced eregi() with preg_match() and get_class() for thirdparty

This commit is contained in:
abraar
2010-12-10 14:09:28 +00:00
parent 016eeae8a2
commit 96abdb996a
20 changed files with 50 additions and 51 deletions

View File

@@ -233,7 +233,7 @@ class Form extends XmlForm
} }
} }
foreach($this->fields as $k => $v){ 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; $this->fields[$k]->owner =& $this;
} }
} }

View File

@@ -228,7 +228,7 @@ class XML_ extends Tree {
} }
else { else {
foreach($this->nodes as $node) { 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]) { if($node->tag->getTagName() == $tags[1]) {
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
$attributeValue = $node->getTagAttribute($attributeName, $newTagPath); $attributeValue = $node->getTagAttribute($attributeName, $newTagPath);
@@ -255,7 +255,7 @@ class XML_ extends Tree {
$tagValue = $this->getXMLContent(); $tagValue = $this->getXMLContent();
else { else {
foreach($this->nodes as $node) { 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]) { if($node->tag->getTagName() == $tags[1]) {
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
$tagValue = $node->getTagContent($newTagPath); $tagValue = $node->getTagContent($newTagPath);
@@ -337,7 +337,7 @@ class XML_ extends Tree {
function hasBranch() { function hasBranch() {
$hasBranch = false; $hasBranch = false;
foreach($this->nodes as $node) { foreach($this->nodes as $node) {
if(strtolower(get_class($node)) == "xmlbranch") { if(is_object($node) && strtolower(get_class($node)) == "xmlbranch") {
$hasBranch = true; $hasBranch = true;
break; break;
} }
@@ -353,7 +353,7 @@ class XML_ extends Tree {
function hasLeaf() { function hasLeaf() {
$hasLeaf = false; $hasLeaf = false;
foreach($this->nodes as $node) { foreach($this->nodes as $node) {
if(strtolower(get_class($node)) == "xmlleaf") { if(is_object($node) && strtolower(get_class($node)) == "xmlleaf") {
$hasLeaf = true; $hasLeaf = true;
break; break;
} }
@@ -407,7 +407,7 @@ class XML_ extends Tree {
*/ */
function removeAllBranches() { function removeAllBranches() {
foreach($this->nodes as $key => $value) { 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]); unset($this->nodes[$key]);
} }
} }
@@ -418,7 +418,7 @@ class XML_ extends Tree {
*/ */
function removeAllLeafs() { function removeAllLeafs() {
foreach($this->nodes as $key => $value) { 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]); unset($this->nodes[$key]);
} }
} }
@@ -469,7 +469,7 @@ class XML_ extends Tree {
*/ */
function setBranchTag($branchId, $tag) { function setBranchTag($branchId, $tag) {
$success = true; $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); $this->nodes[$branchId]->setTag($tag);
else else
$success = false; $success = false;
@@ -484,7 +484,7 @@ class XML_ extends Tree {
*/ */
function setTag($tag) { function setTag($tag) {
$success = true; $success = true;
if(strtolower(get_class($tag)) == "tag") if(is_object($tag) && strtolower(get_class($tag)) == "tag")
$this->tag = $tag; $this->tag = $tag;
else else
$success = false; $success = false;
@@ -513,7 +513,7 @@ class XML_ extends Tree {
$arrKeys = array_keys($this->nodes); $arrKeys = array_keys($this->nodes);
for($index = 0; $index < count($arrKeys); $index ++) { for($index = 0; $index < count($arrKeys); $index ++) {
$node =& $this->nodes[$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]) { if($node->tag->getTagName() == $tags[1]) {
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
$success = $node->setTagAttribute($attributeName, $attributeValue, $newTagPath); $success = $node->setTagAttribute($attributeName, $attributeValue, $newTagPath);
@@ -553,7 +553,7 @@ class XML_ extends Tree {
$arrKeys = array_keys($this->nodes); $arrKeys = array_keys($this->nodes);
for($index = 0; $index < count($arrKeys); $index ++) { for($index = 0; $index < count($arrKeys); $index ++) {
$node =& $this->nodes[$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]) { if($node->tag->getTagName() == $tags[1]) {
$newTagPath = implode($this->pathSeparator, array_slice($tags, 1)); $newTagPath = implode($this->pathSeparator, array_slice($tags, 1));
$success = $node->setTagContent($content, $newTagPath); $success = $node->setTagContent($content, $newTagPath);

View File

@@ -59,7 +59,7 @@ class XMLBranch extends XML_ {
*/ */
function setParentXML(&$xml) { function setParentXML(&$xml) {
$success = false; $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; $this->parentXML = &$xml;
$success = true; $success = true;
} }

View File

@@ -61,7 +61,7 @@ class XMLLeaf extends Leaf {
*/ */
function setParentXML(&$xml) { function setParentXML(&$xml) {
$success = false; $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; $this->parentXML = &$xml;
$success = true; $success = true;
} }

View File

@@ -171,7 +171,7 @@ function MakeFontDescriptor($fm,$symbolic)
//StemV //StemV
if(isset($fm['StdVW'])) if(isset($fm['StdVW']))
$stemv=$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; $stemv=120;
else else
$stemv=70; $stemv=70;
@@ -289,9 +289,9 @@ function CheckTTF($file)
} }
/******************************************************************************* /*******************************************************************************
* $fontfile : chemin du fichier TTF (ou cha<68>ne vide si pas d'incorporation) * * $fontfile : chemin du fichier TTF (ou cha<68>ne vide si pas d'incorporation) *
* $afmfile : chemin du fichier AFM * * $afmfile : chemin du fichier AFM *
* $enc : encodage (ou cha<68>ne vide si la police est symbolique) * * $enc : encodage (ou cha<68>ne vide si la police est symbolique) *
* $patch : patch optionnel pour l'encodage * * $patch : patch optionnel pour l'encodage *
* $type : type de la police si $fontfile est vide * * $type : type de la police si $fontfile est vide *
*******************************************************************************/ *******************************************************************************/

View File

@@ -234,7 +234,7 @@ function MakeFontDescriptor($fm,$symbolic) {
//StemV //StemV
if (isset($fm['StdVW'])) { if (isset($fm['StdVW'])) {
$stemv=$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; $stemv=120;
} else { } else {
$stemv=70; $stemv=70;

View File

@@ -37,7 +37,7 @@ function &traverse_dom_tree_pdf(&$root) {
function dump_tree(&$box, $level) { function dump_tree(&$box, $level) {
print(str_repeat(" ", $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)) { if (isset($box->content)) {
for ($i=0; $i<count($box->content); $i++) { for ($i=0; $i<count($box->content); $i++) {

View File

@@ -249,7 +249,7 @@ class OS_Guess
{ {
if (strcspn($fragment, '*?') < strlen($fragment)) { if (strcspn($fragment, '*?') < strlen($fragment)) {
$reg = '^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '$'; $reg = '^' . str_replace(array('*', '?', '/'), array('.*', '.', '\\/'), $fragment) . '$';
return eregi($reg, $value); return preg_match($reg, $value);
} }
return ($fragment == '*' || !strcasecmp($fragment, $value)); return ($fragment == '*' || !strcasecmp($fragment, $value));
} }

View File

@@ -254,7 +254,7 @@ class PEAR_Registry extends PEAR
*/ */
function _lock($mode = LOCK_EX) 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)) { if ($mode != LOCK_UN && is_resource($this->lock_fp)) {
// XXX does not check type of lock (LOCK_SH/LOCK_EX) // XXX does not check type of lock (LOCK_SH/LOCK_EX)
return true; return true;

View File

@@ -1300,12 +1300,13 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
return $token; return $token;
} }
// If it's a string (of maximum 255 characters) // 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; return $token;
} }
// if it's a function call // 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; return $token;
} }
@@ -1582,7 +1583,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
return $result; return $result;
} }
// if it's a function call // 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(); $result = $this->_func();
return $result; return $result;

View File

@@ -376,7 +376,7 @@ class XML_Parser extends PEAR
/** /**
* check, if file is a remote file * 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')) { if (!ini_get('allow_url_fopen')) {
return $this->raiseError('Remote files cannot be parsed, as safe mode is enabled.', XML_PARSER_ERROR_REMOTE); 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; return true;
} }
// see if it's an absolute URL (has a scheme at the beginning) // 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); return $this->setInputFile($fp);
} }
// see if it's a local file // see if it's a local file

View File

@@ -311,7 +311,7 @@ class soap_server extends nusoap_base {
// get the character encoding of the incoming request // get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -340,7 +340,7 @@ class soap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -374,7 +374,7 @@ class soap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -791,7 +791,7 @@ class soap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@@ -442,7 +442,7 @@ class soapclient extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@@ -3340,7 +3340,7 @@ class soap_server_colosa extends nusoap_base_colosa {
// get the character encoding of the incoming request // get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3369,7 +3369,7 @@ class soap_server_colosa extends nusoap_base_colosa {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3403,7 +3403,7 @@ class soap_server_colosa extends nusoap_base_colosa {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3629,7 +3629,7 @@ class soap_server_colosa extends nusoap_base_colosa {
function serialize_return() { function serialize_return() {
$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI); $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
// if fault // 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->debug('got a fault object from method');
$this->fault = $this->methodreturn; $this->fault = $this->methodreturn;
return; return;
@@ -3820,7 +3820,7 @@ class soap_server_colosa extends nusoap_base_colosa {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -6832,7 +6832,7 @@ class soapclient_colosa extends nusoap_base_colosa {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@@ -3343,7 +3343,7 @@ class soap_server extends nusoap_base {
// get the character encoding of the incoming request // get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3372,7 +3372,7 @@ class soap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3406,7 +3406,7 @@ class soap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -3823,7 +3823,7 @@ class soap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@@ -6829,7 +6829,7 @@ class soapclient extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@@ -68,7 +68,7 @@ class RbacUsers extends BaseRbacUsers {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( RbacUsersPeer::USR_USERNAME, $sUsername ); $c->add ( RbacUsersPeer::USR_USERNAME, $sUsername );
$rs = RbacUsersPeer::doSelect( $c ); $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); $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
//verify password with md5, and md5 format //verify password with md5, and md5 format
//if ( $aFields['USR_PASSWORD'] == md5 ($sPassword ) ) { //if ( $aFields['USR_PASSWORD'] == md5 ($sPassword ) ) {
@@ -101,7 +101,7 @@ class RbacUsers extends BaseRbacUsers {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( RbacUsersPeer::USR_USERNAME, $sUsername ); $c->add ( RbacUsersPeer::USR_USERNAME, $sUsername );
$rs = RbacUsersPeer::doSelect( $c ); $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 //return the row for futher check of which Autentificacion method belongs this user
$this->fields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);; $this->fields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);;
@@ -126,7 +126,7 @@ class RbacUsers extends BaseRbacUsers {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( RbacUsersPeer::USR_UID, $sUserId ); $c->add ( RbacUsersPeer::USR_UID, $sUserId );
$rs = RbacUsersPeer::doSelect( $c ); $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; return 1;
} }
@@ -147,7 +147,7 @@ class RbacUsers extends BaseRbacUsers {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( RbacUsersPeer::USR_UID, $sUsrUid ); $c->add ( RbacUsersPeer::USR_UID, $sUsrUid );
$rs = RbacUsersPeer::doSelect( $c ); $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); $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
return $aFields; return $aFields;
} }

View File

@@ -70,7 +70,7 @@ class Systems extends BaseSystems {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( SystemsPeer::SYS_CODE, $SysUid ); $c->add ( SystemsPeer::SYS_CODE, $SysUid );
$rs = SystemsPeer::doSelect( $c ); $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); $aFields = $rs[0]->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME ); $this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
return $aFields; return $aFields;
@@ -91,7 +91,7 @@ class Systems extends BaseSystems {
$c = new Criteria( 'rbac' ); $c = new Criteria( 'rbac' );
$c->add ( SystemsPeer::SYS_CODE, $SysUid ); $c->add ( SystemsPeer::SYS_CODE, $SysUid );
$rs = SystemsPeer::doSelect( $c ); $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; if ( $exists ) return;

View File

@@ -104,7 +104,7 @@ class AppMessage extends BaseAppMessage {
if(isset($aData['app_msg_uid'])) { if(isset($aData['app_msg_uid'])) {
$o = EmployeePeer::retrieveByPk($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->fromArray($aData, BasePeer::TYPE_FIELDNAME);
$o->setAppMsgDate(date('Y-m-d H:i:s')); $o->setAppMsgDate(date('Y-m-d H:i:s'));
$o->save(); $o->save();

View File

@@ -18,8 +18,6 @@ class UsersProperties extends BaseUsersProperties {
function UserPropertyExists($sUserUID) { function UserPropertyExists($sUserUID) {
try { try {
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID); $oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID);
var_dump($oUserProperty);
var_dump($sUserUID);
if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') { if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') {
echo"inside"; echo"inside";
return true; return true;

View File

@@ -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;} O:8:"stdClass":3:{s:4:"name";s:3:"rtl";s:11:"description";s:24:"description of skin rtl ";s:7:"version";i:2;}