]> git.mjollnir.org Git - s9y.git/commitdiff
trackback/pingback: Fixed legth configuration name, deleted Charset configuration...
authorbrockhaus <brockhaus>
Sun, 13 Jan 2008 11:30:22 +0000 (11:30 +0000)
committerbrockhaus <brockhaus>
Sun, 13 Jan 2008 11:30:22 +0000 (11:30 +0000)
docs/NEWS
include/functions_trackbacks.inc.php

index 58c91caf888e177247daa5fff4894417d921ae89..650934dd0e1a602c1d340afb3c1fe345da2f5217 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -9,13 +9,11 @@ Version 1.3 ()
       (brockhaus)
 
     * Pingback/Trackback textfetching: HTML Entities are now converted
-      to characters. Character encoding defaults to UTF-8 but can be 
-      configured via $serendipity['pingbackEntityEncoding'] = "UTF-8"
-      in your serendipity_config_local.php (brockhaus)
+      to characters. (brockhaus)
 
     * For Pingback it is now possible to define the maximum amount of
       characters while fetching text of the remote site. Add 
-      $serendipity['pingbackFetchPageMaxLenght'] = 200 to your 
+      $serendipity['pingbackFetchPageMaxLength'] = 200 to your 
       serendipity_config_local.php. (brockhaus)
 
     * Add ability to set comments as "pending" again, even when already
index 8e4b8faf255cfe2692943a0e8afd755a56eca3aa..3573fd7179d60d3c69db9f7e91855e21b2841f3d 100644 (file)
@@ -494,15 +494,9 @@ function fetchPingbackData( &$comment) {
     
     // Max amount of characters fetched from the page doing a pingback:
     $fetchPageMaxLenght = 200;
-    if (isset($serendipity['pingbackFetchPageMaxLenght'])){
-        $fetchPageMaxLenght = $serendipity['pingbackFetchPageMaxLenght'];
+    if (isset($serendipity['pingbackFetchPageMaxLength'])){
+        $fetchPageMaxLenght = $serendipity['pingbackFetchPageMaxLength'];
     }
-    // HTML Entity Encoding
-    $entityEncoding = "UTF-8";
-    if (isset($serendipity['pingbackEntityEncoding'])){
-        $entityEncoding = $serendipity['pingbackEntityEncoding'];
-    }
-    
     require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
     $url = $comment['url'];
     
@@ -521,7 +515,7 @@ function fetchPingbackData( &$comment) {
 
         // Get a title
         if (preg_match('@<head[^>]*>.*?<title[^>]*>(.*?)</title>.*?</head>@is',$fContent,$matches)) {
-            $comment['title'] = html_entity_decode(strip_tags($matches[1]),ENT_COMPAT,$entityEncoding);
+            $comment['title'] = html_entity_decode(strip_tags($matches[1]), ENT_COMPAT, LANG_CHARSET);
         }
         
         // Try to get content from first <p> tag on:
@@ -554,13 +548,8 @@ function trackback_body_strip( $body ){
     // replace non brakeable space with normal space:            
     $body = str_replace('&nbsp;', ' ', $body);
 
-    // HTML Entity Encoding
-    $entityEncoding = "UTF-8";
-    if (isset($serendipity['pingbackEntityEncoding'])){
-        $entityEncoding = $serendipity['pingbackEntityEncoding'];
-    }
     // strip html entities and tags.
-    $body = html_entity_decode(strip_tags($body),ENT_COMPAT,$entityEncoding);
+    $body = html_entity_decode(strip_tags($body), ENT_COMPAT, LANG_CHARSET);
 
     // replace whitespace with single space            
     $body = preg_replace('@\s+@s', ' ', $body);