[geeklog-cvs] geeklog: Use COM_getTextContent

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Jul 26 04:57:51 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6efd092fe26b
changeset: 7190:6efd092fe26b
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Jul 26 09:51:34 2009 +0200
description:
Use COM_getTextContent

diffstat:

 system/lib-pingback.php |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (33 lines):

diff -r c607c286b39b -r 6efd092fe26b system/lib-pingback.php
--- a/system/lib-pingback.php	Sun Jul 26 09:46:15 2009 +0200
+++ b/system/lib-pingback.php	Sun Jul 26 09:51:34 2009 +0200
@@ -260,26 +260,16 @@
     for ($i = 0; $i < $num_matches; $i++) {
         if ($matches[1][$i] == $url) {
             $pos = MBYTE_strpos($html, $matches[0][$i]);
-            $before = strip_tags(MBYTE_substr($html, 0, $pos));
+            $before = COM_getTextContent(MBYTE_substr($html, 0, $pos));
 
             $pos += MBYTE_strlen($matches[0][$i]);
-            $after = strip_tags(MBYTE_substr($html, $pos));
+            $after = COM_getTextContent(MBYTE_substr($html, $pos));
 
-            $linktext = trim(strip_tags($matches[2][$i]));
+            $linktext = COM_getTextContent($matches[2][$i]);
             break;
         }
     }
 
-    $before = trim($before);
-    $after = trim($after);
-
-    // get rid of multiple whitespace
-    $pat = array('/^\s+/', '/\s{2,}/', '/\s+\$/');
-    $rep = array('',       ' ',        '');
-    $before   = preg_replace($pat, $rep, $before);
-    $linktext = preg_replace($pat, $rep, $linktext);
-    $after    = preg_replace($pat, $rep, $after);
-
     $tlen = MBYTE_strlen($linktext);
     if ($tlen >= $xlen) {
         // Special case: The actual link text is already longer (or as long) as



More information about the geeklog-cvs mailing list