ça n'en finit plus ... grmllll ...
authorMoussa NOMBRÉ <mnombre@ca.auf.org>
Tue, 14 Aug 2012 14:43:49 +0000 (10:43 -0400)
committerMoussa NOMBRÉ <mnombre@ca.auf.org>
Tue, 14 Aug 2012 14:43:49 +0000 (10:43 -0400)
lodel-0.9/scripts/nusoap.php

index 4649138..e201c02 100644 (file)
@@ -369,7 +369,7 @@ class nusoap_base {
        case (is_array($val) || $type):
          // detect if struct or array
          $valueType = $this->isArraySimpleOrStruct($val);
-         if($valueType=='arraySimple' || preg_match('^ArrayOf',$type)){
+         if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
            $i = 0;
            if(is_array($val) && count($val)> 0){
              foreach($val as $v){
@@ -539,7 +539,7 @@ class nusoap_base {
        */
        function expandQname($qname){
                // get element prefix
-               if(strpos($qname,':') && !preg_match('^http://',$qname)){
+               if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
                        // get unqualified name
                        $name = substr(strstr($qname,':'),1);
                        // get ns prefix
@@ -975,7 +975,7 @@ class XMLSchema extends nusoap_base  {
         if(count($attrs) > 0){
                foreach($attrs as $k => $v){
                 // if ns declarations, add to class level array of valid namespaces
-                               if(preg_match("^xmlns",$k)){
+                               if(preg_match("/^xmlns/",$k)){
                        //$this->xdebug("$k: $v");
                        //$this->xdebug('ns_prefix: '.$this->getPrefix($k));
                        if($ns_prefix = substr(strrchr($k,':'),1)){
@@ -1073,7 +1073,7 @@ class XMLSchema extends nusoap_base  {
                                        $this->currentComplexType = $attrs['name'];
                                        $this->complexTypes[$this->currentComplexType] = $attrs;
                                        $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
-                                       if(isset($attrs['base']) && preg_match(':Array$',$attrs['base'])){
+                                       if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
                                                $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
                                        } else {
                                                $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
@@ -1084,7 +1084,7 @@ class XMLSchema extends nusoap_base  {
                                        $this->currentElement = false;
                                        $this->complexTypes[$this->currentComplexType] = $attrs;
                                        $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
-                                       if(isset($attrs['base']) && preg_match(':Array$',$attrs['base'])){
+                                       if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
                                                $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
                                        } else {
                                                $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
@@ -1660,7 +1660,7 @@ class soap_transport_http extends nusoap_base {
        */
        function soap_transport_http($url){
                $this->setURL($url);
-               preg_match('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+               preg_match("/'\$Revisio' . 'n: ([^ ]+)'/", $this->revision, $rev);
                $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
        }
 
@@ -1966,7 +1966,7 @@ class soap_transport_http extends nusoap_base {
                        $this->outgoing_headers['Connection'] = 'close';
                        $this->persistentConnection = false;
                }
-               set_magic_quotes_runtime(0);
+               ini_set ("magic_quotes_runtime", 0);
                // deprecated
                $this->encoding = $enc;
        }
@@ -2149,7 +2149,7 @@ class soap_transport_http extends nusoap_base {
                                }
                        }
                        // remove 100 header
-                       if(isset($lb) && preg_match('^HTTP/1.1 100',$data)){
+                       if(isset($lb) && preg_match('/^HTTP\/1.1 100/',$data)){
                                unset($lb);
                                $data = '';
                        }//
@@ -2291,7 +2291,7 @@ class soap_transport_http extends nusoap_base {
                curl_close($this->ch);
                
                // remove 100 header
-               if (preg_match('^HTTP/1.1 100',$data)) {
+               if (preg_match('/^HTTP\/1.1 100/',$data)) {
                        if ($pos = strpos($data,"\r\n\r\n")) {
                                $data = ltrim(substr($data,$pos));
                        } elseif($pos = strpos($data,"\n\n") ) {
@@ -2626,7 +2626,7 @@ class soap_server extends nusoap_base {
                        // get the character encoding of the incoming request
                        if(strpos($this->headers['Content-Type'],'=')){
                                $enc = str_replace('"','',substr(strstr($this->headers["Content-Type"],'='),1));
-                               if(pregi('^(utf-8|US-ASCII|UTF-8)$',$enc)){
+                               if(preg_match('/^(utf-8|US-ASCII|UTF-8)$/',$enc)){
                                        $this->xml_encoding = strtoupper($enc);
                                } else {
                                        $this->xml_encoding = 'US-ASCII';
@@ -2654,7 +2654,7 @@ class soap_server extends nusoap_base {
                                                $enc = substr(strstr($v, '='), 1);
                                                $enc = str_replace('"', '', $enc);
                                                $enc = str_replace('\\', '', $enc);
-                                               if (pregi('^(utf-8|US-ASCII|UTF-8)$', $enc)) {
+                                               if (preg_match('/^(utf-8|US-ASCII|UTF-8)$/', $enc)) {
                                                        $this->xml_encoding = strtoupper($enc);
                                                } else {
                                                        $this->xml_encoding = 'US-ASCII';
@@ -2684,7 +2684,7 @@ class soap_server extends nusoap_base {
                                                        $enc = substr(strstr($v, '='), 1);
                                                        $enc = str_replace('"', '', $enc);
                                                        $enc = str_replace('\\', '', $enc);
-                                                       if (pregi('^(utf-8|US-ASCII|UTF-8)$', $enc)) {
+                                                       if (preg_match('/^(utf-8|US-ASCII|UTF-8)$/', $enc)) {
                                                                $this->xml_encoding = strtoupper($enc);
                                                        } else {
                                                                $this->xml_encoding = 'US-ASCII';
@@ -3005,7 +3005,7 @@ class soap_server extends nusoap_base {
                $payload .= $this->getDebugAsXMLComment();
         }
                $this->outgoing_headers[] = "Server: $this->title Server v$this->version";
-               preg_match('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+               preg_match("/'\$Revisio' . 'n: ([^ ]+)'/", $this->revision, $rev);
                $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
                // Let the Web server decide about this
                //$this->outgoing_headers[] = "Connection: Close\r\n";
@@ -3487,7 +3487,7 @@ class wsdl extends nusoap_base {
             $this->currentSchema->schemaStartElement($parser, $name, $attrs);
             $this->appendDebug($this->currentSchema->getDebug());
             $this->currentSchema->clearDebug();
-        } elseif (preg_match('schema$', $name)) {
+        } elseif (preg_match('/schema$/', $name)) {
                $this->debug('Parsing WSDL schema');
             // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
             $this->status = 'schema';
@@ -3515,7 +3515,7 @@ class wsdl extends nusoap_base {
             if (count($attrs) > 0) {
                 foreach($attrs as $k => $v) {
                     // if ns declarations, add to class level array of valid namespaces
-                    if (preg_match("^xmlns", $k)) {
+                    if (preg_match("/^xmlns/", $k)) {
                         if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
                             $this->namespaces[$ns_prefix] = $v;
                         } else {
@@ -4857,7 +4857,7 @@ class soap_parser extends nusoap_base {
                        $key_localpart = $this->getLocalPart($key);
                        // if ns declarations, add to class level array of valid namespaces
             if($key_prefix == 'xmlns'){
-                               if(preg_match('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
+                               if(preg_match('/^http:\/\/www.w3.org\/[0-9]{4}\/XMLSchema$/',$value)){
                                        $this->XMLSchemaVersion = $value;
                                        $this->namespaces['xsd'] = $this->XMLSchemaVersion;
                                        $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
@@ -5523,7 +5523,7 @@ class mysoapclient extends nusoap_base  {
                // detect transport
                switch(true){
                        // http(s)
-                       case preg_match('^http',$this->endpoint):
+                       case preg_match('/^http/',$this->endpoint):
                                $this->debug('transporting via HTTP');
                                if($this->persistentConnection == true && is_object($this->persistentConnection)){
                                        $http =& $this->persistentConnection;
@@ -5545,10 +5545,10 @@ class mysoapclient extends nusoap_base  {
                                        $http->setEncoding($this->http_encoding);
                                }
                                $this->debug('sending message, length: '.strlen($msg));
-                               if(preg_match('^http:',$this->endpoint)){
+                               if(preg_match('/^http:/',$this->endpoint)){
                                //if(strpos($this->endpoint,'http:')){
                                        $this->responseData = $http->send($msg,$timeout,$response_timeout);
-                               } elseif(preg_match('^https',$this->endpoint)){
+                               } elseif(preg_match('/^https/',$this->endpoint)){
                                //} elseif(strpos($this->endpoint,'https:')){
                                        //if(phpversion() == '4.3.0-dev'){
                                                //$response = $http->send($msg,$timeout,$response_timeout);
@@ -5605,7 +5605,7 @@ class mysoapclient extends nusoap_base  {
                if (strpos($headers['content-type'], '=')) {
                        $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
                        $this->debug('Got response encoding: ' . $enc);
-                       if(pregi('^(utf-8|US-ASCII|UTF-8)$',$enc)){
+                       if(preg_match('/^(utf-8|US-ASCII|UTF-8)$/',$enc)){
                                $this->xml_encoding = strtoupper($enc);
                        } else {
                                $this->xml_encoding = 'US-ASCII';