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


PHP FrmAppHelper::sanitize_request方法代码示例

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


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

示例1: sanitize_entry_post

 /**
  * Sanitize the POST values before we use them
  *
  * @since 2.0
  * @param array $values The POST values by reference
  */
 public static function sanitize_entry_post(&$values)
 {
     $sanitize_method = array('form_id' => 'absint', 'frm_action' => 'sanitize_title', 'form_key' => 'sanitize_title', 'item_key' => 'sanitize_title', 'item_name' => 'sanitize_text_field', 'frm_saving_draft' => 'absint', 'is_draft' => 'absint', 'post_id' => 'absint', 'parent_item_id' => 'absint', 'created_at' => 'sanitize_text_field', 'updated_at' => 'sanitize_text_field');
     FrmAppHelper::sanitize_request($sanitize_method, $values);
 }
开发者ID:rbkhrlstn,项目名称:formidable-forms,代码行数:11,代码来源:FrmEntry.php

示例2: test_sanitize_request

 /**
  * @covers FrmAppHelper::sanitize_request
  */
 function test_sanitize_request()
 {
     $values = array('form_id' => '<script></script>12', 'frm_action' => '<script></script>create me', 'form_key' => '<script></script>This is a <b>text</b> field', 'content' => '<script></script>This is a <b>text</b> field');
     $sanitize_method = array('form_id' => 'absint', 'frm_action' => 'sanitize_title', 'form_key' => 'sanitize_text_field', 'content' => 'wp_kses_post');
     FrmAppHelper::sanitize_request($sanitize_method, $values);
     $this->assertEquals($values['form_id'], absint($values['form_id']));
     $this->assertEquals($values['frm_action'], sanitize_title($values['frm_action']));
     $this->assertEquals($values['form_key'], sanitize_text_field($values['form_key']));
     $this->assertEquals($values['content'], wp_kses_post($values['content']));
 }
开发者ID:rbkhrlstn,项目名称:formidable-forms,代码行数:13,代码来源:test_FrmAppHelper.php


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