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 // app/Helpers/ShellCommandHelper.php namespace App\Helpers; class ShellComma..
Decoded Output download
<?php
// app/Helpers/ShellCommandHelper.php
namespace App\Helpers;
class ShellCommandHelper
{
public static function execute($command, $isDebug = true)
{
try {
$output = null;
if($isDebug) {
// Execute the command
$output = shell_exec($command . " 2>&1");
}else {
// Execute the command
$output = shell_exec($command);
}
// Check if the command was successful
if ($output === null) {
// Optionally, you can customize the exception message and code
throw new \Exception('Failed to execute shell command: ' . $command . ' -> ' . $output, 500);
}
// Return the output if needed
return $output;
} catch (\Exception $e) {
throw $e;
}
}
}
?>
Did this file decode correctly?
Original Code
<?php
// app/Helpers/ShellCommandHelper.php
namespace App\Helpers;
class ShellCommandHelper
{
public static function execute($command, $isDebug = true)
{
try {
$output = null;
if($isDebug) {
// Execute the command
$output = shell_exec($command . " 2>&1");
}else {
// Execute the command
$output = shell_exec($command);
}
// Check if the command was successful
if ($output === null) {
// Optionally, you can customize the exception message and code
throw new \Exception('Failed to execute shell command: ' . $command . ' -> ' . $output, 500);
}
// Return the output if needed
return $output;
} catch (\Exception $e) {
throw $e;
}
}
}
Function Calls
None |
Stats
MD5 | bb2dfab24cc70ad7eb202fdb9da2c3bf |
Eval Count | 0 |
Decode Time | 56 ms |