Development

#3766: sfBrowser.patch

You must first sign up to be able to contribute.

Ticket #3766: sfBrowser.patch

File sfBrowser.patch, 0.9 kB (added by francois, 7 months ago)
  • lib/util/sfBrowser.class.php

    old new  
    297297    } 
    298298 
    299299    // for HTML/XML content, create a DOM and sfDomCssSelector objects for the response content 
    300     if (preg_match('/(x|ht)ml/i', $response->getContentType())) 
     300    if (preg_match('/(x|ht)ml/i', $response->getContentType(), $matches)) 
    301301    { 
    302302      $this->dom = new DomDocument('1.0', sfConfig::get('sf_charset')); 
    303303      $this->dom->validateOnParse = true; 
    304       @$this->dom->loadHTML($response->getContent()); 
     304      if($matches[1] == 'x') 
     305      { 
     306        $this->dom->loadXML($response->getContent()); 
     307      } 
     308      else 
     309      { 
     310        $this->dom->loadHTML($response->getContent()); 
     311      } 
    305312      $this->domCssSelector = new sfDomCssSelector($this->dom); 
    306313    } 
    307314    else