Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11632

Multiple files with emtpy lines before <?php and after ?> in CVS.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.2, 1.8.2, 1.9
    • 1.7.3, 1.8.3, 1.9
    • Other
    • None
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      There are multiple issues with Moodle files containing empty or blank lines[1] and/or white space before or after the PHP open and close tags, notably with config.php and theme files. ([1] Lines consisting of only white spaces or tabs.)

      So I've decided to search them all and request the developers to nuke them smile. As there are tons of files, I've come up with the following find + Perl one-liner that does all the dirty job automagicaly (run it at the top of your CVS working copy directory):

      find . -type f -exec perl -e '$/ = undef; $_ = <>; print $ARGV . "\n" if ((m#^([ t\n])<?php#si) or (m#?>\n([ \t\n])$#s) or (m#?>([ \t]+)$#s))' {} ";"

      It prints the paths of the offending files. As of today, there are 35 files having this 'problem'.

      If there is no objection to this, I can do it myself, but I'd want to get '+1' from some core developers first.

      Saludos. Iñaki.

      Attachments

        Activity

          People

            iarenaza Iñaki Arenaza
            iarenaza Iñaki Arenaza
            Nobody Nobody
            Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Oct/07