for ($i = 0; $i < strlen($ftext); $i++) { if ($ftext[$i] == '<') { $counting = false; } if ($counting) { $goodCharCount++; } if ($ftext[$i] == '>') { $counting = true; } if ($goodCharCount >= $textCharThresh) { break; } } $snippet = substr($ftext, 0, $i); $snippet = PSU::closeOpenTags($snippet); list($snippet) = preg_split('/\\s\\w+$/', $snippet); $xtra = preg_replace('/( \\w+)$/', '', trim($snippet)); $xtra = preg_replace('/\\[...\\]/', '', $xtra); $text = $xtra; $text .= ' <a href="' . $item->handled_link . '" target="_blank">...</a>'; } else { $text = $ftext; } //end else if ($bad_rss) { $text = html_entity_decode($text); } $test = preg_match('/<img(.*)src( ){0,1}=( ){0,1}(.*?).flickr.com\\/(.*?)\\/>/', $text, $matches); if (stripos($matches[0], 'flickr') !== false) { $orgstr = $matches[0];