src/PHPDish/Bundle/MediaBundle/Twig/MediaExtension.php
public function processBodyImage($body)
    {
        return preg_replace_callback('#<img src="(.*)"#', function($matches){
            if (strpos('http', $matches[1]) === 0) {
                return $matches[0];
            }
            return str_replace($matches[1], $this->baseUrl . $matches[1], $matches[0]);
        }, $body);
    }
public function processBodyImage($body)
    {
        return preg_replace_callback('#<img src="(.*)"#', function($matches){
            if (strpos('http', $matches[1]) === 0) {
                return $matches[0];
            }
            return str_replace($matches[1], $this->baseUrl . $matches[1], $matches[0]);
        }, $body);
    }
处理内容中的图片地址

@param string $body
@return string