EllisLab text mark
Advanced Search
     
I think i found a new bug , but im not sure (involves escaping & validation->run)
Posted: 23 June 2007 03:04 PM   [ Ignore ]
Joined: 2007-06-22
7 posts

I am currenly trying to get my form validation correct and somehow CI is throwing away some of the ‘\’ if i use it in the input fields. Below is the debugging code i used to pinpoint the problem.

$this->validation->set_error_delimiters('<div class="error">''</div>');

        if( 
count($_POST)){
            
echo("Voor: ");
            echo(
$this->validation->name " ");

        
}

        
if ($this->validation->run() == FALSE)//validation failed, reload the view
            
$data['query_groups'$this->db->get('user_groups');
            
        if(
false || count($_POST)){
            
echo("NA: ");
            echo(
$this->validation->name);
            exit;
        

this gives the following output:

Vooraaa\bbb NAaaabbb 

I checked everything until the validation->run and right at that point the ‘\’ disappears.

Im not sure if this is already known since i know there are already some bugreports involving escaping.

(PS i know there shouldn’t be any backslashes in a name anyway smile )

I think i found it:

line 663 in validation.php

return str_replace(array("'"'"''<''>'), array("&#39;""&quot;"'<''>'), stripslashes($str)); 

There shouldn’t be a stripslashes there right?

EDIT
I also posted this in the bug topic just to be sure it is known .

 
Posted: 30 October 2012 12:04 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-08-08
15 posts

EDIT

 Signature 

I’m new in CodeIgniter.