Re: FormBrowser and Security
Posted: Thu Aug 30, 2012 5:55 pm
I'm using this UDT below on another site that is using CMSMS 1.10.2, FormBuilder 0.7.1 and FormBrowser 0.4. I cannot get this UDT to work as the cc number still shows. I have also tried to use the "replacement" variable and that did not work either.
Is anyone aware of any changes that might have taken place in the newer CMSMS and module versions that would make this not work?
Is anyone aware of any changes that might have taken place in the newer CMSMS and module versions that would make this not work?
Peciura wrote: Lets cal this UDT "update_fb_response"UsageCode: Select all
/*It updates existing data only*/ /*$params['field_ids']*/ /*mandatory*/ /*comma separated field_id list, spaces will be trimmed*/ /*$params['resp_ids']*/ /*comma separated list of responce IDs, spaces will be trimmed. If no response id is supplied - all values will be overvritten*/ /*$params['replacement']='' */ /*replace values in DB with*/ /*$params['assign']*/ /*assign sql result to. If ($assign === false), sql query failed*/ if (!empty($params['field_ids'])){ if (!isset($params['replacement'])){ $params['replacement'] = ''; } $fields = array(); $query = 'UPDATE '.cms_db_prefix().'module_fb_resp_val set value=? WHERE ('; array_push($fields, $params['replacement']); $field_ids = explode(',',$params['field_ids']); foreach($field_ids as $field){ array_push($fields, trim($field)); $query .= ' field_id = ? or '; } $query = rtrim( $query, 'o r'); $query .= ' ) and '; if (isset($params['resp_ids'])) { $resp_ids = explode(',', $params['resp_ids']); foreach($resp_ids as $resp_id){ array_push($fields, trim($resp_id)); $query .= ' resp_id = ? or '; } $query = rtrim( $query, 'o r'); } else{ $query = rtrim( $query, 'na d'); } /* var_dump($query); var_dump($fields); exit; */ global $gCms; $db = $gCms->GetDb(); $assign = $db->Execute($query, $fields); if (!empty($params['assign'])){ $gCms->smarty->assign($params['assign'], $assign); } } return;
Use at your own riskCode: Select all
{update_fb_response field_ids='123, 9999'}