View Issue Details

IDProjectCategoryView StatusLast Update
0003841Composrcorepublic2019-11-11 20:15
ReporterChris GrahamAssigned ToChris Graham 
SeverityFeature-request 
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0003841: Review single-line templates
DescriptionThe code strips the trailing line from a file containing a single line...

    // Strip off trailing final lines from single lines templates. Editors often put these in, and it causes annoying "visible space" issues
    if ((substr($template_contents, -1, 1) === "\n") && (substr_count($template_contents, "\n") === 1)) {
        $template_contents = substr($template_contents, 0, strlen($template_contents) - 1);
    }

Yet the testCorrectLineTerminationAndLineFormat test is defining exceptions for files which do not have to have any line breaks, which contradicts it.

The original rule in our code is fine, and the test exceptions should be removed, with the trailing line added to those templates. That makes us consistent with the common coding standard of always having a trailing line break on any text file.
TagsRoadmap: v11, Type: Standards compliance
Time estimation (hours)1
Sponsorship open

Activities

Chris Graham

2019-06-28 02:39

administrator   ~0006010

Also review if maybe some of these templates should just be hard-coded into the .php, or changed into language strings. We no longer have a zero-HTML policy within our .php, for performance reasons.

Issue History

Date Modified Username Field Change
2019-06-28 02:36 Chris Graham New Issue
2019-06-28 02:36 Chris Graham Tag Attached: Type: Standards compliance
2019-06-28 02:37 Chris Graham Tag Attached: Roadmap: v11
2019-06-28 02:39 Chris Graham Note Added: 0006010
2019-11-11 20:15 Chris Graham Assigned To => Chris Graham
2019-11-11 20:15 Chris Graham Status non-assigned => resolved
2019-11-11 20:15 Chris Graham Resolution open => fixed