當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。