Skip to content

Commit 4b22cd9

Browse files
author
Flavius12
committed
Update phartools.php
1 parent 3ac9d2d commit 4b22cd9

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

phartools.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* PharTools (v1.0) by EvolSoft
55
* Developer: EvolSoft (Flavius12)
66
* Website: http://www.evolsoft.tk
7-
* Date: 23/04/2015 02:25 PM (UTC)
7+
* Date: 25/04/2015 12:00 AM (UTC)
88
* Copyright & License: (C) 2015 EvolSoft
99
* Licensed under MIT (https://github.com/EvolSoft/PharTools/blob/master/LICENSE)
1010
*/
@@ -33,7 +33,7 @@
3333
$regex = null;
3434
$metadata = null;
3535
$compression = null;
36-
for($i = 0; $i < count($params) - 1; $i++){
36+
for($i = 0; $i <= count($params) - 1; $i++){
3737
if($params[$i] == "-c"){ //Check Compression
3838
if(substr($params[$i + 1], 0, 1) != "-"){
3939
if(strtolower($params[$i + 1]) == "gzip" || strtolower($params[$i + 1]) == "gz"){
@@ -65,8 +65,16 @@
6565
}else{
6666
echo "Invalid regular expression specified!\n";
6767
}
68-
}elseif(substr($params[$i], 0, 1) == "-"){ //Check if is a option
69-
echo "\"" . $params[$i] . "\" option not recognized\n";
68+
}else{
69+
if($i == count($params)){
70+
if(substr($params[$i + 1], 0, 1) == "-"){ //Check if is a option
71+
echo "\"" . $params[$i + 1] . "\" option not recognized\n";
72+
}
73+
}else{
74+
if(substr($params[$i], 0, 1) == "-"){ //Check if is a option
75+
echo "\"" . $params[$i] . "\" option not recognized\n";
76+
}
77+
}
7078
}
7179
}
7280
if(file_exists($argv[2])){

0 commit comments

Comments
 (0)