Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
Ensure correct Hash file output
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyrob committed Jul 6, 2018
1 parent 8281faa commit 333e2ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hashes-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$wp_file = zip_entry_read( $zip_entry, zip_entry_filesize( $zip_entry ) );
if ( substr( zip_entry_name( $zip_entry ), -1, 1 ) !== '/' && false === strstr( zip_entry_name( $zip_entry ), 'wp-content/plugins/' ) && false === strstr( zip_entry_name( $zip_entry ), 'wp-content/themes/' ) ) {
list( $wp, $filename ) = explode( '/', zip_entry_name( $zip_entry ), 2 );
$hashes .= "'" . $filename . "' => '" . md5( $wp_file ) . "',\n";
$hashes .= "\t'" . $filename . "' => '" . md5( $wp_file ) . "',\n";
}
zip_entry_close( $zip_entry );
}
Expand All @@ -42,10 +42,10 @@
}

if ( 'cli' === php_sapi_name() ) {
print '<?php' . "\r\n" . $hashes . ");\n?>";
print '<?php' . "\n" . $hashes . ");\n";
} else {
echo 'Hashes for ' . $file;
echo '<pre>';
echo '&lt;?php' . "\r\n" . $hashes . ");\n?>";
echo '&lt;?php' . "\n" . $hashes . ");\n";
echo '</pre>';
}

0 comments on commit 333e2ce

Please sign in to comment.