started diff parser
[phpgitweb.git] / htdocs / lib / ContentProvider.class.php
index 76b2eb0f1e1a508053a9df9d46d1c8048fbd703a..cbfd7c332301c7ebd5b7d8d2463dd6b33536879f 100644 (file)
@@ -112,8 +112,9 @@ class ContentProvider {
                else {
                        $template_html = $this->load_template($this->template, $subtemplate);
                }
-               $template_html = preg_replace_callback('/%([^%]*)%/', array($this, "replace_placeholder"), $template_html);
-               $template_html = preg_replace_callback('/%([^%]*)%/', array($this, "replace_placeholder"), $template_html);
+               $template_html = preg_replace('/([\r\n]*)$/mD', '', $template_html);
+               $template_html = preg_replace_callback('/%([^%\n]*)%/', array($this, "replace_placeholder"), $template_html);
+               $template_html = preg_replace_callback('/%([^%\n]*)%/', array($this, "replace_placeholder"), $template_html);
                
                return $template_html;
        }