comparison admin.php @ 67:251a4c4e05d1

Fix de quelques bugs sur les trackbacks. o Le port n'était pas correctement utilisé dans la requête envoyant le trackback, alors que cela fonctionnait correctement sur la requête de demande d'informations o Le message et l'adresse du post n'était pas correctement récupéré.
author Franck Deroche <webmaster@defr.org>
date Tue, 18 Mar 2008 18:47:19 +0100
parents 25c6e59f019e
children d67a65183100
comparison
equal deleted inserted replaced
66:4723204733ef 67:251a4c4e05d1
74 74
75 // Essai de récuperation de l'encodage...Envoie en iso si pas d'indication d'UTF... 75 // Essai de récuperation de l'encodage...Envoie en iso si pas d'indication d'UTF...
76 $argToSend = "__info=1"; 76 $argToSend = "__info=1";
77 $toSend = $genToSend . "Content-Length: " . strlen($argToSend) . "\n\n"; 77 $toSend = $genToSend . "Content-Length: " . strlen($argToSend) . "\n\n";
78 $toSend .= $argToSend; 78 $toSend .= $argToSend;
79 echo("<pre>$toSend</pre>");
80 fwrite($fp, $toSend); 79 fwrite($fp, $toSend);
81 while(!feof($fp)) 80 while(!feof($fp))
82 $result .= fgets($fp, 128); 81 $result .= fgets($fp, 128);
83 fclose($fp); 82 fclose($fp);
84 if(!preg_match('/<encoding>(UTF-8|utf-8)<\/encoding>/msU',$result)) { 83 if(!preg_match('/<encoding>(UTF-8|utf-8)<\/encoding>/msU',$result)) {
85 $row['Titre'] = utf8_decode($row['Titre']); 84 $row['Titre'] = utf8_decode($row['Titre']);
86 $row['Message'] = utf8_decode($row['Message']); 85 $row['Message'] = utf8_decode($row['Message']);
87 } 86 }
88 87
89 $fp = fsockopen($ar_tbAddress['host'], 80, $errno, $errstr, 15); 88 $fp = fsockopen($ar_tbAddress['host'], $ar_tbAddress['port'], $errno, $errstr, 15);
90 $argToSend = "title=" . htmlentities(urlencode($row['Titre'])) . "&blog_name=Dual+Blog"; 89 $argToSend = "title=" . htmlentities(urlencode($row['Titre'])) . "&blog_name=Dual+Blog";
91 $argToSend .= "&url=" . BLOG_URL . "/posts/{$row['num_mess']}&excerpt=" 90 $argToSend .= "&url=" . BLOG_URL . "/posts/{$id_row['num_mess']}&excerpt="
92 . htmlentities(urlencode(substr(strip_tags($row['Message']), 0, 255) . "...")); 91 . htmlentities(urlencode(substr(strip_tags($id_row['Message']), 0, 255) . "..."));
93 92
94 $toSend = $genToSend . "Content-Length: " . strlen($argToSend) . "\n\n"; 93 $toSend = $genToSend . "Content-Length: " . strlen($argToSend) . "\n\n";
95 $toSend .= $argToSend; 94 $toSend .= $argToSend;
96 echo("<pre><![CDATA[$toSend]]></pre>");
97 echo("<![CDATA["); 95 echo("<![CDATA[");
98 fwrite($fp, $toSend); 96 fwrite($fp, $toSend);
99 while (!feof($fp)) { 97 while (!feof($fp)) {
100 echo fgets($fp, 128); 98 echo fgets($fp, 128);
101 } 99 }