Created
January 3, 2011 15:03
-
-
Save Pross/763539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class NewLineCheck implements themecheck { | |
protected $error = array(); | |
function check( $php_files, $css_files, $other_files) { | |
$ret = true; | |
foreach ($php_files as $name => $content) { | |
checkcount(); | |
if ( preg_match('/\?>[\r\n]+^[\r\n]+<\?php/m',$content, $matches) ) { | |
$filename = tc_filename( $name ); | |
if ( $filename === 'functions.php' ) { | |
$this->error[] = "<span class='tc-lead tc-warning'>WARNING</span>: new line <strong>{$filename}</strong> file."; | |
$ret = false; | |
} | |
} | |
} | |
// return the pass/fail | |
return $ret; | |
} | |
function getError() { return $this->error; } | |
} | |
$themechecks[] = new NewLineCheck; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment