@@ -41,7 +41,7 @@ public function getFileHeaderComment( $sFilePath, array $aCommentItems ) {
4141 $ fp = fopen ( $ sFilePath , 'r ' );
4242
4343 // Pull only the first 8 KB of the file in.
44- $ _bsFileData = fread ( $ fp , 8 * KB_IN_BYTES );
44+ $ _bsFileData = fread ( $ fp , 8 * 1024 );
4545
4646 // PHP will close file handle, but we are good citizens.
4747 fclose ( $ fp );
@@ -50,12 +50,12 @@ public function getFileHeaderComment( $sFilePath, array $aCommentItems ) {
5050 $ _bsFileData = str_replace ( "\r" , "\n" , $ _bsFileData );
5151
5252 $ _aCommentItems = $ aCommentItems ;
53- foreach ( $ _aCommentItems as $ field => $ regex ) {
54- if ( preg_match ( '/^[ \t\/*#@]* ' . preg_quote ( $ regex , '/ ' ) . ':(.*)$/mi ' , $ _bsFileData , $ match ) && $ match [ 1 ] ) {
55- $ _aCommentItems [ $ field ] = $ this ->___getFileHeaderCommentCleaned ( $ match [ 1 ] );
56- } else {
57- $ _aCommentItems [ $ field ] = '' ;
53+ foreach ( $ _aCommentItems as $ _sKey => $ regex ) {
54+ if ( preg_match ( '/^[ \t\/*#@]* ' . preg_quote ( $ regex , '/ ' ) . ':?(.*)$/mi ' , $ _bsFileData , $ match ) && $ match [ 1 ] ) {
55+ $ _aCommentItems [ $ _sKey ] = $ this ->___getFileHeaderCommentCleaned ( $ match [ 1 ] );
56+ continue ;
5857 }
58+ $ _aCommentItems [ $ _sKey ] = '' ;
5959 }
6060 return $ _aCommentItems ;
6161
0 commit comments