当前位置: 首页>>代码示例>>PHP>>正文


PHP DataUtil::sanitizeDataByDesignerTypeForSavingModel方法代码示例

本文整理汇总了PHP中DataUtil::sanitizeDataByDesignerTypeForSavingModel方法的典型用法代码示例。如果您正苦于以下问题:PHP DataUtil::sanitizeDataByDesignerTypeForSavingModel方法的具体用法?PHP DataUtil::sanitizeDataByDesignerTypeForSavingModel怎么用?PHP DataUtil::sanitizeDataByDesignerTypeForSavingModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataUtil的用法示例。


在下文中一共展示了DataUtil::sanitizeDataByDesignerTypeForSavingModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSanitizeDataByDesignerTypeForSavingModel

 /**
  * @depends testPurifyHtmlAndModifyInputUsingArrayWalkRecursive
  */
 public function testSanitizeDataByDesignerTypeForSavingModel()
 {
     $data = array('firstName' => 'Steve', 'lastName' => 'Thunder<SCRIPT>alert(\'XSS\')</SCRIPT>', 'boolean' => '0', 'date' => '3/25/11', 'dateTime' => '04/05/11 5:00 AM', 'float' => '3.68', 'integer' => '10', 'phone' => '435655', 'string' => 'some string<SCRIPT>alert(\'XSS\')</SCRIPT>', 'textArea' => 'more text here<SCRIPT>alert(\'XSS\')</SCRIPT>', 'url' => 'http://www.zurmo.org', 'dropDown' => array('value' => 'test value<SCRIPT>alert(\'XSS\')</SCRIPT>'), 'radioDropDown' => array('value' => 'my value'), 'multiDropDown' => array('values' => array('multi1', 'multi2')), 'tagCloud' => array('values' => 'tag1,tag2<SCRIPT>alert(\'XSS\')</SCRIPT>'));
     $model = new TestDataUtilModel();
     $sanitizedData = DataUtil::sanitizeDataByDesignerTypeForSavingModel($model, $data);
     $compareData = array('firstName' => 'Steve', 'lastName' => 'Thunder', 'boolean' => '0', 'date' => DateTimeUtil::resolveValueForDateDBFormatted('3/25/11'), 'dateTime' => DateTimeUtil::convertDateTimeLocaleFormattedDisplayToDbFormattedDateTimeWithSecondsAsZero('04/05/11 5:00 AM'), 'float' => '3.68', 'integer' => '10', 'phone' => '435655', 'string' => 'some string', 'textArea' => 'more text here', 'url' => 'http://www.zurmo.org', 'dropDown' => array('value' => 'test value'), 'radioDropDown' => array('value' => 'my value'), 'multiDropDown' => array('values' => array('multi1', 'multi2')), 'tagCloud' => array('values' => array('tag1', 'tag2')));
     $this->assertEquals($compareData, $sanitizedData);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:DataUtilTest.php

示例2: sanitizePostByDesignerTypeForSavingModel

 /**
  * Sanitizes post data for date and date time attributes by converting them to the proper
  * format and timezone for saving.
  * @return - array sanitized post data
  */
 public static function sanitizePostByDesignerTypeForSavingModel($model, $postData)
 {
     $postData = DataUtil::sanitizeDataByDesignerTypeForSavingModel($model, $postData);
     return $postData;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:PostUtil.php


注:本文中的DataUtil::sanitizeDataByDesignerTypeForSavingModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。