Skip to Main Content
Secure Development for Mobile Apps
book

Secure Development for Mobile Apps

by J. D. Glaser
October 2014
Intermediate to advanced content levelIntermediate to advanced
472 pages
10h 44m
English
Auerbach Publications
Content preview from Secure Development for Mobile Apps
153
temPlAte strAtegy PAtterns
<?php
//Ensure input is UTF-8
mb_substitute_character(0xFFFD);
class Cleaner
{
private $data;
public function setData(&$input)
{
//make incoming array private to protect contents
foreach($input as $key = > $field)
{
//ensure each string is valid UTF-8 before testing
//replace invalid characters with U+FFFD character
$t his->data[$key] = mb _ convert _ encoding($field, 'UTF-8',
'U T F - 8');
}
//destroy the original to make it publicly inaccessible
$input = null;
}
public function setValidators($required_fields)
{
foreach($required_fields as $key = > $field)
{
//check incoming array against the required array
//only keep data we want
//assign the incoming element key
//1) a filter function
//2) the incoming value
if(array_key_exists($key, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Developing with Web Standards

Developing with Web Standards

John Allsopp
Mobile Cloud Computing

Mobile Cloud Computing

Dijiang Huang, Huijun Wu

Publisher Resources

ISBN: 9781482209037