fix validation of offset-value in domain import + minor fixes
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -198,5 +198,3 @@ return array(
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -1889,7 +1889,7 @@ if ($page == 'domains'
|
||||
|
||||
$customerid = intval($_POST['customerid']);
|
||||
$separator = validate($_POST['separator'], 'separator');
|
||||
$offset = intval($_POST['offset']);
|
||||
$offset = validate($_POST['offset'], 'offset', "/[0-9]/i");
|
||||
|
||||
$file_name = $_FILES['file']['tmp_name'];
|
||||
|
||||
|
||||
@@ -103,7 +103,9 @@ class DomainBulkAction {
|
||||
*/
|
||||
public function __construct($import_file = null, $customer_id = 0) {
|
||||
|
||||
$this->_impFile = makeCorrectFile($import_file);
|
||||
if (!empty($import_file)) {
|
||||
$this->_impFile = makeCorrectFile($import_file);
|
||||
}
|
||||
$this->_custId = $customer_id;
|
||||
|
||||
}
|
||||
@@ -135,10 +137,14 @@ class DomainBulkAction {
|
||||
throw new Exception("Invalid separator specified: '" . $separator . "'");
|
||||
}
|
||||
|
||||
if (! is_numeric($offset) || $offset < 0) {
|
||||
if (! is_int($offset) || $offset < 0) {
|
||||
throw new Exception("Invalid offset specified");
|
||||
}
|
||||
|
||||
|
||||
if ($this->_custId <= 0) {
|
||||
throw new Exception("Invalid customer selected");
|
||||
}
|
||||
|
||||
$this->_readCustomerData();
|
||||
|
||||
if (is_null($this->_custData)) {
|
||||
|
||||
Reference in New Issue
Block a user