Jump to content


bluepicaso

Member Since 19 Mar 2012
Offline Last Active Aug 26 2014 06:14 AM
-----

Posts I've Made

In Topic: textarea with ckeditor/tinymce does not save data

28 July 2014 - 06:29 AM

Solution found at

http://blog.codebust...st-after-update

 create a file called "MY_Security.php" in application/code

code

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
*
* Extend Security controller
*
*/

class MY_Security extends CI_Security
{
function __construct()
{
parent::__construct();
}

protected function _remove_evil_attributes($str, $is_image)
{
// All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns
$evil_attributes = array('on\w*', 'xmlns');

if ($is_image === TRUE)
{
/*
* Adobe Photoshop puts XML metadata into JFIF images,
* including namespacing, so we have to allow this for images.
*/
unset($evil_attributes[array_search('xmlns', $evil_attributes)]);
}

do {
$str = preg_replace(
"#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i",
"<$1$6",
$str, -1, $count
);
} while ($count);

return $str;
}

}

thats it.


In Topic: textarea with ckeditor/tinymce does not save data

25 July 2014 - 07:27 AM

alright its saving now. but here is another problem.
Its not saving the inline style of a copy pasted html code, even when i paste it in the source as html itself..

Any good reasons?


In Topic: textarea with ckeditor/tinymce does not save data

15 July 2014 - 10:11 AM

that should not be practically the problem.. check up what all data is being posted.. !!

also.. do share in the code and table structure and we might be able 2 help u

table structure
aImSnAOl.jpg

Code:
 

public function manageEmailers() {
    if(checkSession()){
      $this->load->library('grocery_CRUD');
      $crud = new grocery_CRUD();
      $crud->set_theme('flexigrid');
      $crud->set_table('emailers');
      $crud->columns('email_subject', 'trigger_on', 'is_active');
      $crud->field_type('is_active','dropdown',array('0'=>'no', '1' => 'yes'));
      $crud->required_fields('email_subject', 'email_body', 'static_text');
      $crud->columns('email_subject', 'email_body', 'trigger_on');
      $state = $crud->getState();
      if($state == 'add' || $state == 'edit'){ 
        $data['admin_js'] = "jQuery(document).ready(function() {jQuery('#email_body_input_box').prepend('<div class=\'admin_notice\'><b>Dynamic keywords:</b> {site_url}, {activation_link}, {user_full_name}, {user_profile_link}, {daily_v_convos}, {static_text} <br> <b>Usage syntax : welcome {user_full_name}, thank you </b> </div>');});";
      }
      $crud->set_js('js/crud.js');
      $crud->post_ajax_callbacks('trigLinks()');
      $crud->unset_read();
      $crud->unset_delete();
      $crud->unset_texteditor('email_body');
      
      $output = $crud->render();
      $data['title']="Manage Emailers";
      $data['adminMenu']=1;
      $output = array_merge($data,(array)$output);
      $this->_outputData($output);
    }
    else{
      $this->session->set_flashdata('msg', 'Your session has expired please login again');
      redirect('welcome/index');
      return;
    }
  }

In Topic: jquery conflict?

23 May 2014 - 09:55 AM

same issue with me


In Topic: Do Javascript function after ajax_list finished

13 May 2014 - 08:07 AM

works like a charm, awesome hack