Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php $table = new PhabricatorAuthSSHKey(); $conn_w = $table->establishConnection('w'); ..
Decoded Output download
<?php
$table = new PhabricatorAuthSSHKey();
$conn_w = $table->establishConnection('w');
echo pht('Updating SSH public key indexes...')."
";
$keys = new LiskMigrationIterator($table);
foreach ($keys as $key) {
$id = $key->getID();
echo pht('Updating key %d...', $id)."
";
try {
$hash = $key->toPublicKey()->getHash();
} catch (Exception $ex) {
echo pht('Key has bad format! Removing key.')."
";
queryfx(
$conn_w,
'DELETE FROM %T WHERE id = %d',
$table->getTableName(),
$id);
continue;
}
$collision = queryfx_all(
$conn_w,
'SELECT * FROM %T WHERE keyIndex = %s AND id < %d',
$table->getTableName(),
$hash,
$key->getID());
if ($collision) {
echo pht('Key is a duplicate! Removing key.')."
";
queryfx(
$conn_w,
'DELETE FROM %T WHERE id = %d',
$table->getTableName(),
$id);
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET keyIndex = %s WHERE id = %d',
$table->getTableName(),
$hash,
$key->getID());
}
echo pht('Done.')."
";
?>
Did this file decode correctly?
Original Code
<?php
$table = new PhabricatorAuthSSHKey();
$conn_w = $table->establishConnection('w');
echo pht('Updating SSH public key indexes...')."\n";
$keys = new LiskMigrationIterator($table);
foreach ($keys as $key) {
$id = $key->getID();
echo pht('Updating key %d...', $id)."\n";
try {
$hash = $key->toPublicKey()->getHash();
} catch (Exception $ex) {
echo pht('Key has bad format! Removing key.')."\n";
queryfx(
$conn_w,
'DELETE FROM %T WHERE id = %d',
$table->getTableName(),
$id);
continue;
}
$collision = queryfx_all(
$conn_w,
'SELECT * FROM %T WHERE keyIndex = %s AND id < %d',
$table->getTableName(),
$hash,
$key->getID());
if ($collision) {
echo pht('Key is a duplicate! Removing key.')."\n";
queryfx(
$conn_w,
'DELETE FROM %T WHERE id = %d',
$table->getTableName(),
$id);
continue;
}
queryfx(
$conn_w,
'UPDATE %T SET keyIndex = %s WHERE id = %d',
$table->getTableName(),
$hash,
$key->getID());
}
echo pht('Done.')."\n";
Function Calls
None |
Stats
MD5 | 1c0c0691423e1771a876190f785eb551 |
Eval Count | 0 |
Decode Time | 70 ms |