Skip to content

Commit 2075583

Browse files
committed
Merge pull request kbjr#7 from woolfg/escapedarguments
commit message shellescaped, thus, injection is prevented
2 parents 41d61a3 + 8bc9087 commit 2075583

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CI_Git.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function add($files = "*") {
263263
* @return string
264264
*/
265265
public function commit($message = "") {
266-
return $this->run("commit -av -m \"$message\"");
266+
return $this->run("commit -av -m ".escapeshellarg($message));
267267
}
268268

269269
/**

Git.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function add($files = "*") {
256256
* @return string
257257
*/
258258
public function commit($message = "") {
259-
return $this->run("commit -av -m \"$message\"");
259+
return $this->run("commit -av -m ".escapeshellarg($message));
260260
}
261261

262262
/**

0 commit comments

Comments
 (0)