PHP / CodeIgniter - $ _POST data completely disappears when submitting a form in bizarre circumstances

EDITOR: I think something worked for me. . This symbol - - seems to break it. If I use "regular" apostrophe ( '), it works fine, if I replace every exaggerated apostrophe in its usual, he delivers just fine. So the next question is: why does this fantastic apostrophe break CodeIgniter or PHP? I assume this is a CI error, but please correct me if I am wrong. In any case, here, to the question that I originally posted, I would still like to get some idea of ​​why this is happening, and if I can do a lot with this:


I tear my hair off of it. This is totally strange, and I just can't solve it.

Firstly, I have a basic form:

<?php $attributes = array('class' => 'form1'); $selected="";
echo form_open('admin/edit_page/'.$page->row('id'), $attributes); ?>

    <div>               
        <?php echo form_error('title'); ?>
        <label>Page Title:</label><input type="text" maxlength="100" name="title" value="<?php echo $page->row('title');?>" />
    </div>

    <div class="textarea">
        <?php echo form_error('content'); ?>
        <label>Page Content:</label><textarea name="content"><?php echo $page->row('content');?></textarea>
    </div>

    <div class="no">
        <input type="submit" value="Submit"/>
    </div>

</form>

Then I have the corresponding CI function:

function edit_page($id)
{
    $this->form_validation->set_rules('title', 'Title', 'trim|required|max_length[50]');
    $this->form_validation->set_rules('content', 'Content', 'trim|required');

    // If validation has failed...
    if ($this->form_validation->run() == FALSE)
    {
        $data['page'] = $this->gallery_model->get_page($id);

        $this->load->view('admin/header');
        $this->load->view('admin/editpage', $data);
        $this->load->view('admin/footer');
    }
    else    // Validation successful
    {
        $title = $this->input->post('title');
        $content = $this->input->post('content');
        $this->gallery_model->edit_page($id, $title, $content);
        redirect('admin');
    }

}

Everything is OK so far, yes? Here where the crazy problem begins.

  • I can "manually" enter any data that I like into the "Content" field. I click "Submit", everything works as expected - the database is updated with my new data, everything is fine in the world.
  • I can copy and paste 15 paragraphs of Lorem Ipsum or something in this field. Hit submit, hooray.
  • :. , : http://jeremywebbphotography.com/biog.php - , - . , - , " ", - .
  • WebKit Inspector , $_POST...
  • , edit_page die("Content is ".$_POST['content']); - , . "". .
  • title - .
  • , - -, ( ) - , "Biog", ( ), !.

WTF?!

, , :

  • ( Chrome Dev Mac OS X Snow Leopard - Safari Firefox, )
  • CI XSS Filtering Security Sanitizing - ,
  • CI. .
  • , (), - . .
  • htmlspecialchars htmlentities , .

. , , :

How I'm copy-pasting

( , ?) - , , ( CSS-, ):

How it looks

+5
2

Text Helper ascii_to_entities:

$this->load->helper('text');
$content = $this->input->post('content');
$content = ascii_to_entities($content);


ascii_to_entities():

ASCII , ASCII MS Word, -, . , , 100% , (, ).

+1

, , $this->input->post('postvar') $_POST['postvar']. , CodeIgniter post.

+2

All Articles