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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2, 1.8.2, 1.9
    • Fix Version/s: 1.7.3, 1.8.3, 1.9
    • Component/s: Other
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Oct/07