Changeset 589 for trunk/lib


Ignore:
Timestamp:
Mar 18, 2017 12:34:38 PM (7 years ago)
Author:
anonymous
Message:

Updated the strip_whitespace regex to fix some errors found on the FWR admin site.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/JS.inc.php

    r574 r589  
    182182                // Strip whitespace and print file.
    183183                echo preg_replace(
    184                     array('!^\s*//.*$!m', '!/\*.*?\*/!s', '/[\n\r]+/', '/[ \t]*}[ \t]*/', '/\s*{\s*/', '/\s*=\s*/', '/^\s+/m'),
    185                     array('', '', "\n", '}', '{', '=', ''), file_get_contents($file, true)
     184                    array('/(?<=^|;|{)\s*\/\/.*$/m', '/(?<=^|;|{)\s*\/\*.*?\*\//ms', '/[\n\r]+/', '/[ \t]+}[ \t]+/', '/[ \t]+{[ \t]+/', '/\s+=\s+/', '/^[ \t]+/m', '/[ \t]+$/m'),
     185                    array('', '', "\n", '}', '{', '=', '', ''), file_get_contents($file, true)
    186186                );
    187187            } else {
     
    189189                include $file;
    190190            }
     191            // Make sure there's at least one new-line between files.
     192            echo "\n";
    191193        }
    192194
Note: See TracChangeset for help on using the changeset viewer.