{
$this->title;
$rest = fread($this->file, filesize($this->page));
- if ( preg_match('{\n<p>(<img [^>]*>)</p>\s*\z}', $rest, $img, PREG_OFFSET_CAPTURE) ) {
+ if ( preg_match('{\n<p>(<img [^>]*>)</p>}', $rest, $img, PREG_OFFSET_CAPTURE) ) {
$this->img = $img[1][0];
return substr($rest, 0, $img[0][1]);
}
$article = new ArchiveArticle($filename);
print '<li>';
if ($article->thumb) {
- printf('<img src="/%s" class="left" />', $article->thumb);
+ $img = preg_replace('{(?<= \b src="/) [^"]* }x', $article->thumb, $article->img);
+ $img = preg_replace('{(?= />$)}', ' class="left"', $img);
+ print $img;
}
print '<article>';
printf(