Skip to content

Commit

Permalink
Merge pull request #126 from hannob/avoidshell
Browse files Browse the repository at this point in the history
Use native PHP to read IBAN files, avoid call to shell
  • Loading branch information
globalcitizen authored Mar 24, 2024
2 parents 50bf5cc + 611a21a commit f5e474e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions utils/obfuscation-test.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
require_once(dirname(dirname(__FILE__)) . '/php-iban.php');
$dir = dirname(__FILE__);
$ibans = `cat $dir/example-ibans/*`;
$lines = explode("\n",$ibans);
foreach($lines as $iban) {
$ibans = [];
foreach (glob(dirname(__FILE__) . "/example-ibans/*") as $file) {
$ibans += file($file);
}
foreach($ibans as $iban) {
$iban = iban_to_machine_format($iban);
print iban_to_human_format($iban) . "\n";
print iban_to_obfuscated_format($iban) . "\n";
Expand Down

0 comments on commit f5e474e

Please sign in to comment.