Changeset 1743 for trunk/xmlrpc.php

Show
Ignore:
Timestamp:
09/10/2008 07:44:37 PM (4 months ago)
Author:
driehle
Message:

Bugfix #194

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r1736 r1743  
    110110                $utf8 = 'application/xhtml+xml' == strtolower(trim($s->getResponseHeader("Content-Type"))); 
    111111 
    112             $this->title = empty($title[1]) ? $this->sourceURI : html_entity_decode($utf8 ? utf8_decode($title[1]) : $title[1]); 
     112            // since text in database is utf8 encoded, we need to *en*code the title to utf8 if it isn't already, not *de*code it 
     113            $this->title = empty($title[1]) ? $this->sourceURI : html_entity_decode($utf8 ? $title[1] : utf8_encode($title[1])); 
    113114        } 
    114115 
     
    189190 
    190191    function Jlog_SendPingback($html, $pagelinkedfrom, $useragent) { 
    191         $this->pagelinkedfrom = $pagelinkedfrom; 
     192        // neet to prevent & in url 
     193        $this->pagelinkedfrom = htmlspecialchars_decode($pagelinkedfrom); 
    192194        $this->useragent = $useragent; 
    193195 
     
    198200        for($i = 0; $count > $i; $i++) { 
    199201            if(substr($pageslinkedto[$i], 0, 4) !== "http") unset($pageslinkedto[$i]); 
    200             else $pageslinkedto[$i] = str_replace(array('&quot;','&lt;', '&gt;', '&amp;'), array('"', '<', '>', '&'), $pageslinkedto[$i]); 
     202            // htmlspecialchars_decode is easier than str_replace 
     203            else $pageslinkedto[$i] = htmlspecialchars_decode($pageslinkedto[$i]); 
    201204        } 
    202205        $this->pageslinkedto = $pageslinkedto;