[eluser]Rvnikita[/eluser]
Hi.
I Have the code like this:
Code:
$this->form_validation->set_rules('bannerfile_fake', 'Файл', 'required|callback_banner_file_check[123]');
function banner_file_check($file, $param)
{
echo '<pre>';
print_r($param);
echo '</pre>';
die("!!!");
}
And $param don't have '123' value.
It's empty.
I looked at the source code and found in form_validation string 496:
Code:
if (preg_match("/(callback_\w+)/", implode(' ', $rules), $match))
And if I changed it to
Code:
if (preg_match("/(callback_.+)/", implode(' ', $rules), $match))
Everythink is all write.
As I understand, we lose the param, because the preg_march don't understand '[' and ']' with '\w+'
Is this a bug or may be it's bug in my head?
Thank's