aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/SearchController.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers/SearchController.php')
-rw-r--r--h-source/Application/Controllers/SearchController.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/h-source/Application/Controllers/SearchController.php b/h-source/Application/Controllers/SearchController.php
index 1b35a09..cb314c5 100644
--- a/h-source/Application/Controllers/SearchController.php
+++ b/h-source/Application/Controllers/SearchController.php
@@ -111,9 +111,9 @@ class SearchController extends BaseController
$lspci = $this->request->post('lspci','','sanitizeHtml');
$lspciResult = array();
- $flag = false;
+ $flag = true;
- if (strlen($lspci)<10000)
+ if (strlen($lspci)<50000)
{
$lspci = nl2br($lspci);
$lspciArray = explode('<br />',$lspci);
@@ -124,12 +124,11 @@ class SearchController extends BaseController
if (stristr($item,'Slot'))
{
$temp = array();
-
// class
if (next($lspciArray) !== false)
{
$item = trim(current($lspciArray));
- if( !preg_match( '/^[a-zA-Z0-9\-\_\.\:\+\s\(\)\/\[\]]+$/i', $item ) )
+ if( !preg_match( '/^[a-zA-Z0-9\-\_\.\,\;\:\+\s\(\)\/\[\]]+$/i', $item ) )
{
$flag = false;
break;
@@ -155,7 +154,7 @@ class SearchController extends BaseController
if (next($lspciArray) !== false)
{
$item = trim(current($lspciArray));
- if( !preg_match( '/^[a-zA-Z0-9\-\_\.\:\+\s\(\)\/\[\]]+$/i', $item ) )
+ if( !preg_match( '/^[a-zA-Z0-9\-\_\.\,\;\:\+\s\(\)\/\[\]]+$/i', $item ) )
{
$flag = false;
break;
@@ -181,7 +180,7 @@ class SearchController extends BaseController
if (next($lspciArray) !== false)
{
$item = trim(current($lspciArray));
- if( !preg_match( '/^[a-zA-Z0-9\-\_\.\:\+\s\(\)\/\[\]]+$/i', $item ) )
+ if( !preg_match( '/^[a-zA-Z0-9\-\_\.\,\;\:\+\s\(\)\/\[\]]+$/i', $item ) )
{
$flag = false;
break;
@@ -204,18 +203,19 @@ class SearchController extends BaseController
}
$lspciResult[] = $temp;
- $flag = true;
}
next($lspciArray);
}
- if (count($lspciResult) === 0)
+ if (count($lspciResult) === 0 or $flag === false)
{
$data['notice'] = "<div class='alert'>".gtext('the text submitted by you does not seem the lspci -vmmnn output. Please check the text and try again')."</div>\n";
+ $flag = false;
}
}
else
{
$data['notice'] = "<div class='alert'>the lspci output is too long</div>\n";
+ $flag = false;
}
$data['flag'] = $flag;