Perform regex check in is_valid_receipt (#655)

This commit is contained in:
jekkos
2016-06-16 17:40:26 +02:00
parent 86b22e7987
commit 9e675e81ec
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
php5-apcu
RUN a2enmod rewrite
RUN docker-php-ext-install mysql mysqli
RUN docker-php-ext-install mysql mysqli bcmath
WORKDIR /app
COPY . /app

View File

@@ -251,9 +251,9 @@ class Receiving_lib
function is_valid_receipt($receipt_receiving_id)
{
//RECV #
$pieces = explode(' ',$receipt_receiving_id);
$pieces = explode(' ', $receipt_receiving_id);
if(count($pieces)==2)
if(count($pieces) == 2 && preg_match('/(RECV|KIT)/', $pieces[1]);
{
return $this->CI->Receiving->exists($pieces[1]);
}
@@ -262,7 +262,7 @@ class Receiving_lib
return $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->num_rows() > 0;
}
return false;
return FALSE;
}
function is_valid_item_kit($item_kit_id)