Overloaded: Rabo uses longer strings for accountnumbers.

@inheritdoc
427720
protected function sanitizeAccount($string)
    {
        $account = parent::sanitizeAccount($string);
        if (strlen($account) > 20 && strpos($account, '80000') === 0) {
            $account = substr($account, 5);
        }

        return $account;
    }
791747
protected function _serializeAccountID()
        {
        	$isToken = $this->getIsToken();
                $accountID = $this->getAccountID();

                if( $isToken && $isToken != false && $isToken != "false" )
                {
                        return $accountID ? "<AccountID isToken=\"true\">{$accountID}</AccountID>" : '';
                } else {
                        return $accountID ? "<AccountID isToken=\"0\">{$accountID}</AccountID>" : '';
                }
	}
141034
public function validateStringMaxLength($value, $maxLength, $errorMessage, $errorField = null)
    {
        if (strlen($value) > $maxLength) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
939461
public function padStringFilter($value, $padCharacter, $maxLength, $padType = 'STR_PAD_RIGHT')
    {
        if ($this->isNullOrEmptyString($padCharacter)) {
            throw new \InvalidArgumentException('Pad String Filter cannot accept a null value or empty string as its first argument');
        }
        if ( ! is_int($maxLength)) {
            throw new \InvalidArgumentException('Pad String Filter expects its second argument to be an integer');
        }
        $diff = (function_exists('mb_strlen'))? strlen($value) - mb_strlen($value) : 0;
        $padType = constant($padType);

        return str_pad($value, $maxLength + $diff, $padCharacter, $padType);
    }
1057561
static public function maxLength($value, $maxLength, $message = null, $propertyPath = null, $encoding = 'utf8')
        {
            static::string($value, $message);

            if (mb_strlen($value, $encoding) > $maxLength) {
                $message = $message ?: sprintf(
                    'Value "%s" is too long, it should have no more than %d characters, but has %d characters.',
                    static::stringify($value),
                    $maxLength,
                    mb_strlen($value, $encoding)
                );

                $constraints = array('max_length' => $maxLength, 'encoding' => $encoding);

                throw static::createException($value, $message, static::INVALID_MAX_LENGTH, $propertyPath, $constraints);
            }
        }
732352
function accountName( $order = false )
    {
        if ( $order === false )
            $user = eZUser::currentUser();
        else
            $user = $order->attribute( 'user' );

        if ( is_object( $user ) )
        {
            $userObject = $user->attribute( 'contentobject' );
            $accountName = $userObject->attribute( 'name' );
        }
        else
            $accountName = null;
        return $accountName;
    }
1350034
public function parseNumber($bankAccountNumber)
    {
        $pattern = <<<PATTERN
            ~
            ^
            (?:
                ((\d{0,%1\$d})-(\d{%2\$d,%3\$d}))       # account number with two parts
                |                                       # or
                ((\d{%2\$d,%3\$d}))                     # single number
            )?
                \/                                      # slash for separate bank code
                (\d{%4\$d})                             # bank code
            $
            ~xim
PATTERN;

        $pattern = sprintf(
            $pattern,
            self::FIRST_PART_MAX_DIGITS,
            self::SECOND_PART_MIN_DIGITS,
            self::SECOND_PART_MAX_DIGITS,
            self::BANK_CODE_LENGTH
        );

        $firstPart = $secondPart = $bankCode = null;

        preg_match($pattern, $bankAccountNumber, $match);
        if (!empty($match[6])) {
            $bankCode = $match[6];
        }
        if (isset($match[2])
            && '' !== $match[2]
            && isset($match[3])
            && '' !== $match[3]) {
            $firstPart = $match[2];
            $secondPart = $match[3];
        } elseif (!empty($match[5])) {
            $secondPart = $match[5];
        }

        return [$firstPart, $secondPart, $bankCode];
    }
325374
private static function _pad128($data)
    {
        $padlen = 16 - strlen($data) % 16;
        if (16 != $padlen) {
            $data .= str_repeat("\0", $padlen);
        }
        return $data;
    }
690885
public function write_long($n)
    {
        if (($n < 0) || ($n > 4294967295)) {
            throw new AMQPInvalidArgumentException('Long out of range: ' . $n);
        }

        //Numeric strings >PHP_INT_MAX on 32bit are casted to PHP_INT_MAX, damn PHP
        if (empty($this->is64bits) && is_string($n)) {
            $n = (float) $n;
        }
        $this->out .= pack('N', $n);

        return $this;
    }
413020
protected function parseTransactionAccountName()
    {
        $results = parent::parseTransactionAccountName();
        if ($results !== '') {
            return $results;
        }

        $results = [];
        if (preg_match('/:86:(GIRO|BGC\.)\s+[\d]+ (.+)/', $this->getCurrentTransactionData(), $results)
            && !empty($results[2])
        ) {
            return $this->sanitizeAccountName($results[2]);
        }

        if (preg_match('/:86:.+\n(.*)\n/', $this->getCurrentTransactionData(), $results)
            && !empty($results[1])
        ) {
            return $this->sanitizeAccountName($results[1]);
        }

        return '';
    }
435243
protected function parseTransactionAccount()
    {
        $parts = $this->getDescriptionParts();
        $account = $parts[0];
        if (preg_match('#[A-Z]{2}[\d]{2}[A-Z]{4}(.*)#', $parts[2], $results)) {
            $account = $parts[2];
        } elseif (preg_match('#10(\d+)#', $parts[0], $results)) {
            $account = $results[1];
        }

        return $this->sanitizeAccount($account);
    }
1037876
public static function startsWithAlphanumeric($stringOrStrings, $optionOrOptions)
    {
        return self::startsWithInternal($stringOrStrings, $optionOrOptions, false, true, false);
    }
218720
protected function parseTransactionAccount()
    {
        $results = [];
        // YYMMDD[MMDD]2a[1!a]15d1!a3!c16x[//16x][34x]
        // eg.: :61:1203290329DD20000,00NTRF1004688128      //6128522200250001
        // Reference for the Account Owner (16x): 1004688128
        // Reference of the Account Servicing Institution [//16x]: 6128522200250001
        // Supplementary Details [34x]: null
        if (preg_match(self::PATTERN_TAG_61, $this->getCurrentTransactionData(), $results)) {
            return $this->sanitizeAccount($results[7]);
        }

        return '';
    }
989661
public function checkLength($value)
    {
        if (strlen($value) != 8) {
            $this->setCheck(false);
        } else {
            $this->setCheck(true);
        }

        return parent::checkLength($value);
    }
226770
public static String getAccountNumberOfIban(final String pstring) {
    final String compressedIban = ibanCompress(pstring);
    final String country = StringUtils.substring(compressedIban, 0, 2);
    final IbanLengthDefinition length = IBAN_LENGTH_MAP.ibanLengths().get(country);
    return length == null ? null
        : StringUtils.substring(compressedIban, length.getAccountNumberStart(),
            length.getAccountNumberEnd());
  }
1089900
protected function parseTransactionAccountName()
    {
        $results = [];
        // SEPA MT940 Structured
        if (preg_match('#/NAME/(.+?)\n?/(REMI|ADDR|ISDT|CSID)/#ms', $this->getCurrentTransactionData(), $results)) {
            $accountName = trim($results[1]);
            if (!empty($accountName)) {
                return $this->sanitizeAccountName($accountName);
            }
        }

        if (preg_match('/^:61:.*? (.+)/m', $this->getCurrentTransactionData(), $results)) {
            $accountName = trim($results[1]);
            if (!empty($accountName)) {
                return $this->sanitizeAccountName($accountName);
            }
        }

        if (preg_match('/(.*) Betaalautomaat/', $this->parseTransactionDescription(), $results)) {
            $accountName = trim($results[1]);
            if (!empty($accountName)) {
                return $this->sanitizeAccountName($accountName);
            }
        }
        return '';
    }
149506
public function updateAccount()
    {
        $user = Sentinel::getUser();

        //validationRules are declared at beginning
        $this->validationRules['email'] = "required|email|unique:users,email,{$user->email},email";

        if (!$password = Input::get('password')) {
            unset($this->validationRules['password']);
            unset($this->validationRules['password_confirm']);
        }

        $this->validationRules['birthday'] = 'date_format:d/m/Y|before:now';

        // Create a new validator instance from our validation rules
        $validator = Validator::make(Input::all(), $this->validationRules);

        // If validation fails, we'll exit the operation now.
        if ($validator->fails()) {
            // Ooops.. something went wrong
            return Redirect::back()->withInput()->withErrors($validator);
        }

        $email = $user->email;

        // Update the user
        $user->first_name = Input::get('first_name');
        $user->last_name = Input::get('last_name');
        $user->email = Input::get('email');
        $user->gender = Input::get('gender');
        $user->description = Input::get('description');

        if (Input::get('birthday') != null)
            $user->birthday = \Carbon\Carbon::createFromFormat('d/m/Y', Input::get('birthday'));

        $passwordChanged = false;

        // Do we want to update the user password?
        if ($password = Input::get('password'))
        {
            if (Sentinel::validateCredentials($user, [ 'email' => $email, 'password' => Input::get('old-password')]))
            {
                $passwordChanged = true;
                $user->password = Hash::make($password);
            }
            else
            {
                $error = Lang::get('base.auth.wrong_password');
                $validator->messages()->add('old-password', Lang::get('base.auth.wrong_password'));

                // Redirect to the user page
                return Redirect::route('profile')->withInput()->withErrors($validator)->with('error', $error);
            }
        }

        // is new image uploaded?
        if ($file = Input::file('pic')) {
            $extension = $file->getClientOriginalExtension() ?: 'png';
            $folderName = '/uploads/users/';
            $destinationPath = public_path() . $folderName;
            $safeName = str_random(10) . '.' . $extension;
            $file->move($destinationPath, $safeName);

            //delete old pic if exists
            if (File::exists(public_path() . $folderName . $user->pic))
                File::delete(public_path() . $folderName . $user->pic);

            //save new file path into db
            $user->pic = $safeName;

            Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') changed its profile photo. ');
        }

        // Was the user updated?
        if ($user->save()) {
            // Prepare the success message
            $success = Lang::get('base.auth.account.changed');

            if ($passwordChanged)
            {
                Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') changed its password. ');
                Mail::queue('emails.account.password-changed', [ 'user' => $user ], function ($m) use ($user) {
                    $m->to($user->email, $user->first_name . ' ' . $user->last_name);
                    $m->subject(Lang::get('base.mails.password_changed'));
                });
            }

            Base::Log($user->username . ' (' . $user->first_name . ' ' . $user->last_name . ') updated the profile. ');

            // Redirect to the user page
            return Redirect::route('profile')->with('success', $success);
        }

        // Prepare the error message
        $error = Lang::get('base.base.error');

        // Redirect to the user page
        return Redirect::route('profile')->withInput()->with('error', $error);
    }