mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-07 05:57:30 +08:00
Merge pull request #147 from PGYER/dev/master
fix(Command): filter "`" for comamnd (shell inject)
This commit is contained in:
@@ -42,8 +42,8 @@ class Command
|
||||
// return '"' . $argument . '"';
|
||||
|
||||
$pattern = [
|
||||
'/(^|[^\\\\])((\\\\\\\\)*[\s\'\"\$\|])/',
|
||||
'/(^|[^\\\\])((\\\\\\\\)*\\\\([^\s\'\"\|\$\\\\]|$))/'
|
||||
'/(^|[^\\\\])((\\\\\\\\)*[\s\`\'\"\$\|])/',
|
||||
'/(^|[^\\\\])((\\\\\\\\)*\\\\([^\s\`\'\"\|\$\\\\]|$))/'
|
||||
];
|
||||
$replacement = [
|
||||
'$1\\\\$2',
|
||||
|
||||
@@ -1466,14 +1466,14 @@ class Repository_model extends CI_Model
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$branch = Command::wrapArgument($branch);
|
||||
$filePath = Command::wrapArgument($filePath);
|
||||
|
||||
$command = GitCommand::getLastLog($branch, $filePath, $lastSha);
|
||||
if (!$command) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$branch = Command::wrapArgument($branch);
|
||||
$filePath = Command::wrapArgument($filePath);
|
||||
|
||||
$log = $this->execCommand($rKey, $uKey, GIT_COMMAND_QUERY, $command);
|
||||
$log = rtrim($log, Helper::getDelimiter() . "\n");
|
||||
$log = $this->_logStringToArray($log);
|
||||
|
||||
Reference in New Issue
Block a user