• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_check_invalid_utf8函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_check_invalid_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_check_invalid_utf8函数的具体用法?PHP wp_check_invalid_utf8怎么用?PHP wp_check_invalid_utf8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _submit_admin_options

 /**
  * Submit processing for admin_options view
  *
  * @uses update_option()
  * @uses wp_die()
  * @uses wp_verify_nonce()
  */
 private function _submit_admin_options()
 {
     $code_snippet = wp_check_invalid_utf8(htmlentities(stripslashes($_REQUEST['single_drop']), ENT_QUOTES, "UTF-8"));
     $caching = "";
     update_option($this->slug . '_single_drop', $code_snippet);
     // Other cache sources
     if (defined('WP_CACHE') && WP_CACHE == true) {
         $caching = "other";
     }
     // Check for CloudFlare
     if (defined('CLOUDFLARE_VERSION')) {
         $caching = "cloudflare";
     }
     // Check for W3 Total Cache
     if (defined('W3TC')) {
         if (function_exists('w3tc_pgcache_flush_url')) {
             w3tc_pgcache_flush_url("/");
             $caching = "";
         } else {
             $caching = "w3-total-cache";
         }
     }
     // Check for WP Super Cache
     if (function_exists('wpsupercache_site_admin')) {
         $caching = "wp-super-cache";
     }
     // Check for Quick Cache
     if (class_exists('\\quick_cache\\plugin')) {
         $caching = "quick-cache";
     }
     wp_redirect(admin_url('admin.php') . '?page=' . $this->slug . '&message=submit&caching=' . $caching);
     exit;
 }
开发者ID:venturepact,项目名称:blog,代码行数:40,代码来源:filament.php


示例2: sanitize

 /**
  * Sanitize each setting field as needed
  *
  * @param array $input Contains all settings fields as array keys
  */
 public function sanitize($input)
 {
     if (isset($input['widget_rememberme'])) {
         $new_input['widget_rememberme'] = absint($input['widget_rememberme']);
     }
     if (isset($input['code_reset_email_text'])) {
         $filtered = wp_check_invalid_utf8($input['code_reset_email_text']);
     }
     $new_input['code_reset_email_text'] = wp_strip_all_tags($filtered);
     return $new_input;
 }
开发者ID:otacke,项目名称:yalw,代码行数:16,代码来源:settings.php


示例3: of_sanitize_text_field

function of_sanitize_text_field($value, $option)
{
    $defaults = array('html' => false);
    $option = array_merge($defaults, $option);
    if ($option['html']) {
        // don't strip html tags
        return wp_check_invalid_utf8($value);
    } else {
        return sanitize_text_field($value);
    }
}
开发者ID:hungrig4leben,项目名称:my-gp,代码行数:11,代码来源:options-sanitize.php


示例4: build_csp

 public function build_csp()
 {
     $csp = $this->options['content_security_policy'];
     if (!empty($this->options['csp_report_url'])) {
         $csp .= "; report-uri ";
         $csp .= $this->options['csp_report_url'];
     }
     $this->csp = _wp_specialchars(wp_check_invalid_utf8($csp), 'double');
     if (!$this->options['enforce_csp']) {
         $this->csp_type .= '-Report-Only';
     }
 }
开发者ID:bu-ist,项目名称:bu-ssl,代码行数:12,代码来源:bu-ssl.php


示例5: wpcf7_sanitize_query_var

function wpcf7_sanitize_query_var($text)
{
    $text = wp_unslash($text);
    $text = wp_check_invalid_utf8($text);
    if (false !== strpos($text, '<')) {
        $text = wp_pre_kses_less_than($text);
        $text = wp_strip_all_tags($text);
    }
    $text = preg_replace('/%[a-f0-9]{2}/i', '', $text);
    $text = preg_replace('/ +/', ' ', $text);
    $text = trim($text, ' ');
    return $text;
}
开发者ID:abcode619,项目名称:wpstuff,代码行数:13,代码来源:formatting.php


示例6: validateInvoicePostFields

 /**
  * @return array
  * @author Panagiotis Vagenas <[email protected]>
  * @since  151229
  */
 protected function validateInvoicePostFields()
 {
     if (!$this->isTimologioRequest()) {
         return array();
     }
     $validated = array();
     foreach ($this->fields as $fieldName) {
         $value = isset($_POST[$fieldName]) ? wp_strip_all_tags(wp_check_invalid_utf8(stripslashes($_POST[$fieldName]))) : '';
         if (!empty($value)) {
             $validated[$fieldName] = $value;
         }
     }
     return $validated;
 }
开发者ID:panvagenas,项目名称:timologio-for-woocommerce,代码行数:19,代码来源:WcTimologio.php


示例7: si_print_js

/**
 * Output any queued javascript code in the footer.
 */
function si_print_js()
{
    global $si_queued_js;
    if (!empty($si_queued_js)) {
        // Sanitize.
        $si_queued_js = wp_check_invalid_utf8($si_queued_js);
        $si_queued_js = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", $si_queued_js);
        $si_queued_js = str_replace("\r", '', $si_queued_js);
        $js = "<!-- Social Icons JavaScript -->\n<script type=\"text/javascript\">\njQuery(function(\$) { {$si_queued_js} });\n</script>\n";
        /**
         * social_icons_queued_js filter.
         * @param string $js JavaScript code.
         */
        echo apply_filters('social_icons_queued_js', $js);
        unset($si_queued_js);
    }
}
开发者ID:themegrill,项目名称:social-icons,代码行数:20,代码来源:functions-si-core.php


示例8: sanitize_multiline_text_field

/**
 * Filter a sanitized multi line text field string without removing linebreaks and tabs.
 *
 * @since 1.4.3
 *
 * @param string $filtered The sanitized string.
 * @param string $str      The string prior to being sanitized.
 */
function sanitize_multiline_text_field($str)
{
    $filtered = wp_check_invalid_utf8($str);
    if (strpos($filtered, '<') !== false) {
        $filtered = wp_pre_kses_less_than($filtered);
        // This will strip extra whitespace for us.
        $filtered = wp_strip_all_tags($filtered, true);
    }
    $found = false;
    while (preg_match('/%[a-f0-9]{2}/i', $filtered, $match)) {
        $filtered = str_replace($match[0], '', $filtered);
        $found = true;
    }
    if ($found) {
        // Strip out the whitespace that may now exist after removing the octets.
        $filtered = trim(preg_replace('/ +/', ' ', $filtered));
    }
    return $filtered;
}
开发者ID:Jamesits,项目名称:wp-keybase-verification,代码行数:27,代码来源:write.php


示例9: weaverii_validate_all_options


//.........这里部分代码省略.........
                    $val = weaverii_filter_code($value);
                    $in[$key] = $val;
                    if (stripos($val, '<style') !== false || stripos($val, '</style') !== false) {
                        $err_msg .= weaverii_t_('"Add CSS Rules" option must not contain &lt;style&gt; tags!') . weaverii_t_(' Please correct your entry.') . '<br />';
                    }
                }
                break;
            case 'wii_last_option':
                // check for wii_last_option...
                if (!empty($value)) {
                    $wvr_last = $value;
                }
                break;
            case 'hide_advanced_btn':
                if (stripos($value, 'hide') === false) {
                    $in['hide_advanced'] = 'show';
                } else {
                    $in['hide_advanced'] = 'hide';
                }
                break;
            case 'hide_advanced':
                $val = $value;
                if (isset($in['hide_advanced_btn'])) {
                    if (stripos($in['hide_advanced_btn'], 'hide') === false) {
                        $val = 'show';
                    } else {
                        $val = 'hide';
                    }
                }
                $in[$key] = $val;
                break;
            case '_phpactions':
                if (!empty($value)) {
                    $in[$key] = stripslashes(wp_check_invalid_utf8(addslashes($value)));
                }
                break;
            default:
                /* to here, then colors, _css, or checkbox/selectors */
                $keylen = strlen($key);
                if (strrpos($key, '_css') == $keylen - 4) {
                    // all _css settings
                    if (!empty($value)) {
                        $val = weaverii_filter_code($value);
                        $in[$key] = $val;
                        if (strpos($val, '{') === false || strpos($val, '}') === false) {
                            $opt_id = str_replace('_css', '', $key);
                            // kill _css
                            $opt_id = str_replace('wii_', '', $opt_id);
                            $opt_id = str_replace('_', ' ', $opt_id);
                            $err_msg .= weaverii_t_('CSS options must be enclosed in {}\'s: ') . '"' . $opt_id . '" = "' . $value . '".' . weaverii_t_(' Please correct your entry.') . '<br />';
                        }
                    }
                    break;
                }
                // _css
                if (strrpos($key, '_insert') == $keylen - 7) {
                    // all _insert settings
                    if (!empty($value)) {
                        $val = weaverii_filter_code($value);
                        $in[$key] = $val;
                    }
                    break;
                }
                // _insert
                if (strrpos($key, '_url') == $keylen - 4) {
                    // all _url settings
开发者ID:uwmadisoncals,项目名称:weaver2pro,代码行数:67,代码来源:lib-admin.php


示例10: sanitize_text_field

/**
 * Sanitize a string from user input or from the db
 *
 * check for invalid UTF-8,
 * Convert single < characters to entity,
 * strip all tags,
 * remove line breaks, tabs and extra white space,
 * strip octets.
 *
 * @since 2.9.0
 *
 * @param string $str
 * @return string
 */
function sanitize_text_field($str)
{
    $filtered = wp_check_invalid_utf8($str);
    if (strpos($filtered, '<') !== false) {
        $filtered = wp_pre_kses_less_than($filtered);
        // This will strip extra whitespace for us.
        $filtered = wp_strip_all_tags($filtered, true);
    } else {
        $filtered = trim(preg_replace('/[\\r\\n\\t ]+/', ' ', $filtered));
    }
    $found = false;
    while (preg_match('/%[a-f0-9]{2}/i', $filtered, $match)) {
        $filtered = str_replace($match[0], '', $filtered);
        $found = true;
    }
    if ($found) {
        // Strip out the whitespace that may now exist after removing the octets.
        $filtered = trim(preg_replace('/ +/', ' ', $filtered));
    }
    /**
     * Filter a sanitized text field string.
     *
     * @since 2.9.0
     *
     * @param string $filtered The sanitized string.
     * @param string $str      The string prior to being sanitized.
     */
    return apply_filters('sanitize_text_field', $filtered, $str);
}
开发者ID:zhoujiangyou,项目名称:WordPress,代码行数:43,代码来源:formatting.php


示例11: esc_attr

 function esc_attr($text)
 {
     $safe_text = wp_check_invalid_utf8($text);
     $safe_text = _wp_specialchars($safe_text, ENT_QUOTES);
     return apply_filters('attribute_escape', $safe_text, $text);
 }
开发者ID:VizualAbstract,项目名称:Marilyn,代码行数:6,代码来源:disqus.php


示例12: process_checkout

 /**
  * Process the checkout after the confirm order button is pressed
  *
  * @access public
  * @return void
  */
 public function process_checkout()
 {
     global $wpdb, $current_user;
     wp_verify_nonce($_POST['_wpnonce'], 'woocommerce-process_checkout');
     if (!defined('WOOCOMMERCE_CHECKOUT')) {
         define('WOOCOMMERCE_CHECKOUT', true);
     }
     // Prevent timeout
     @set_time_limit(0);
     do_action('woocommerce_before_checkout_process');
     if (sizeof(WC()->cart->get_cart()) == 0) {
         wc_add_notice(sprintf(__('Sorry, your session has expired. <a href="%s" class="wc-backward">Return to homepage</a>', 'woocommerce'), home_url()), 'error');
     }
     do_action('woocommerce_checkout_process');
     // Checkout fields (not defined in checkout_fields)
     $this->posted['terms'] = isset($_POST['terms']) ? 1 : 0;
     $this->posted['createaccount'] = isset($_POST['createaccount']) ? 1 : 0;
     $this->posted['payment_method'] = isset($_POST['payment_method']) ? stripslashes($_POST['payment_method']) : '';
     $this->posted['shipping_method'] = isset($_POST['shipping_method']) ? $_POST['shipping_method'] : '';
     $this->posted['ship_to_different_address'] = isset($_POST['ship_to_different_address']) ? true : false;
     if (isset($_POST['shiptobilling'])) {
         _deprecated_argument('WC_Checkout::process_checkout()', '2.1', 'The "shiptobilling" field is deprecated. THe template files are out of date');
         $this->posted['ship_to_different_address'] = $_POST['shiptobilling'] ? false : true;
     }
     // Ship to billing only option
     if (WC()->cart->ship_to_billing_address_only()) {
         $this->posted['ship_to_different_address'] = false;
     }
     // Update customer shipping and payment method to posted method
     $chosen_shipping_methods = WC()->session->get('chosen_shipping_methods');
     if (isset($this->posted['shipping_method']) && is_array($this->posted['shipping_method'])) {
         foreach ($this->posted['shipping_method'] as $i => $value) {
             $chosen_shipping_methods[$i] = wc_clean($value);
         }
     }
     WC()->session->set('chosen_shipping_methods', $chosen_shipping_methods);
     WC()->session->set('chosen_payment_method', $this->posted['payment_method']);
     // Note if we skip shipping
     $skipped_shipping = false;
     // Get posted checkout_fields and do validation
     foreach ($this->checkout_fields as $fieldset_key => $fieldset) {
         // Skip shipping if not needed
         if ($fieldset_key == 'shipping' && ($this->posted['ship_to_different_address'] == false || !WC()->cart->needs_shipping())) {
             $skipped_shipping = true;
             continue;
         }
         // Ship account if not needed
         if ($fieldset_key == 'account' && (is_user_logged_in() || $this->must_create_account == false && empty($this->posted['createaccount']))) {
             continue;
         }
         foreach ($fieldset as $key => $field) {
             if (!isset($field['type'])) {
                 $field['type'] = 'text';
             }
             // Get Value
             switch ($field['type']) {
                 case "checkbox":
                     $this->posted[$key] = isset($_POST[$key]) ? 1 : 0;
                     break;
                 case "multiselect":
                     $this->posted[$key] = isset($_POST[$key]) ? implode(', ', array_map('wc_clean', $_POST[$key])) : '';
                     break;
                 case "textarea":
                     $this->posted[$key] = isset($_POST[$key]) ? wp_strip_all_tags(wp_check_invalid_utf8(stripslashes($_POST[$key]))) : '';
                     break;
                 default:
                     $this->posted[$key] = isset($_POST[$key]) ? wc_clean($_POST[$key]) : '';
                     break;
             }
             // Hooks to allow modification of value
             $this->posted[$key] = apply_filters('woocommerce_process_checkout_' . sanitize_title($field['type']) . '_field', $this->posted[$key]);
             $this->posted[$key] = apply_filters('woocommerce_process_checkout_field_' . $key, $this->posted[$key]);
             // Validation: Required fields
             if (isset($field['required']) && $field['required'] && empty($this->posted[$key])) {
                 wc_add_notice('<strong>' . $field['label'] . '</strong> ' . __('is a required field.', 'woocommerce'), 'error');
             }
             if (!empty($this->posted[$key])) {
                 // Validation rules
                 if (!empty($field['validate']) && is_array($field['validate'])) {
                     foreach ($field['validate'] as $rule) {
                         switch ($rule) {
                             case 'postcode':
                                 $this->posted[$key] = strtoupper(str_replace(' ', '', $this->posted[$key]));
                                 if (!WC_Validation::is_postcode($this->posted[$key], $_POST[$fieldset_key . '_country'])) {
                                     wc_add_notice(__('Please enter a valid postcode/ZIP.', 'woocommerce'), 'error');
                                 } else {
                                     $this->posted[$key] = wc_format_postcode($this->posted[$key], $_POST[$fieldset_key . '_country']);
                                 }
                                 break;
                             case 'phone':
                                 $this->posted[$key] = wc_format_phone_number($this->posted[$key]);
                                 if (!WC_Validation::is_phone($this->posted[$key])) {
                                     wc_add_notice('<strong>' . $field['label'] . '</strong> ' . __('is not a valid phone number.', 'woocommerce'), 'error');
                                 }
//.........这里部分代码省略.........
开发者ID:Joaquinsemp,项目名称:patriestausado,代码行数:101,代码来源:class-wc-checkout.php


示例13: weaverii_filter_code

function weaverii_filter_code($text)
{
    // Much option input from Weaver Xtreme can be code, and thus must not be
    // content filtered - at least for admins. The utf8 check is about the extent of it, although even
    // that is more restrictive than the standard text widget uses.
    // Note: this check also works OK for simple checkboxes/radio buttons/selections,
    // so it is ok to blindly pass those options in here, too.
    $trimmed = trim($text);
    $noslash = stripslashes($trimmed);
    if ($trimmed == ' ') {
        return '';
    }
    if (current_user_can('unfiltered_html')) {
        return wp_check_invalid_utf8($noslash);
    } else {
        return wp_filter_post_kses($trimmed);
        // wp_filter_post_kses() handles slashes
    }
}
开发者ID:uwmadisoncals,项目名称:weaver2pro,代码行数:19,代码来源:lib-runtime.php


示例14: sanitize_text_field

/**
 * Sanitize a string from user input or from the db
 *
 * check for invalid UTF-8,
 * Convert single < characters to entity,
 * strip all tags,
 * remove line breaks, tabs and extra whitre space,
 * strip octets.
 *
 * @since 2.9
 *
 * @param string $str
 * @return string
 */
function sanitize_text_field($str)
{
    $filtered = wp_check_invalid_utf8($str);
    if (strpos($filtered, '<') !== false) {
        $filtered = wp_pre_kses_less_than($filtered);
        $filtered = wp_strip_all_tags($filtered, true);
    } else {
        $filtered = trim(preg_replace('/\\s+/', ' ', $filtered));
    }
    $match = array();
    while (preg_match('/%[a-f0-9]{2}/i', $filtered, $match)) {
        $filtered = str_replace($match[0], '', $filtered);
    }
    return apply_filters('sanitize_text_field', $filtered, $str);
}
开发者ID:bluedanbob,项目名称:wordpress,代码行数:29,代码来源:formatting.php


示例15: require_billing_information

 public static function require_billing_information($post_id, $post)
 {
     // must be shop order
     if ($post->post_type != 'shop_order') {
         return;
     }
     // only perform this check if the associated option is on
     if (self::$options->{'qsot-require-billing-information'} != 'yes') {
         return;
     }
     // only when the past is being saved in the admin
     if (!isset($_POST['action']) || $_POST['action'] != 'editpost') {
         return;
     }
     // load the order
     $order = wc_get_order($post_id);
     if (!is_object($order) || !isset($order->id)) {
         return;
     }
     // do not perform this check on cancelled orders, because they are irrelevant checks at that point
     if ('cancelled' == $order->get_status()) {
         return;
     }
     // ****** most of this is adapted from the checkout logic from WC2.3.x
     // get all the fields that we should be validating. derived from checkout process
     $fields = WC()->countries->get_address_fields(self::_get_value('_billing_country', $order), '_billing_');
     $errors = array();
     // cycle through each field, and validate the input
     foreach ($fields as $key => $field) {
         // make sure we have a field type
         if (!isset($field['type'])) {
             $field['type'] = 'text';
         }
         // find the submitted value of the field
         switch ($field['type']) {
             // checkboxes are on or off
             case 'checkbox':
                 $value = isset($_POST[$key]) ? 1 : 0;
                 break;
                 // multiselect boxes have multiple values that need cleaning
             // multiselect boxes have multiple values that need cleaning
             case 'multiselect':
                 $value = isset($_POST[$key]) ? implode(', ', array_map('wc_clean', $_POST[$key])) : '';
                 break;
                 // textareas allow for lots of text, so clean that up
             // textareas allow for lots of text, so clean that up
             case 'textarea':
                 $value = isset($_POST[$key]) ? wp_strip_all_tags(wp_check_invalid_utf8(stripslashes($_POST[$key]))) : '';
                 break;
                 // all other fields should be cleaned as well
             // all other fields should be cleaned as well
             default:
                 $value = isset($_POST[$key]) ? is_array($_POST[$key]) ? array_map('wc_clean', $_POST[$key]) : wc_clean($_POST[$key]) : '';
                 break;
         }
         // allow modification of resulting value
         $value = apply_filters('woocommerce_process_checkout_' . sanitize_title($field['type']) . '_field', $value);
         $value = apply_filters('woocommerce_process_checkout_field_' . $key, $value);
         // check required fields
         if (isset($field['required']) && $field['required'] && empty($value)) {
             $error[] = '<strong>' . $field['label'] . '</strong> ' . __('is a required field.', 'woocommerce');
         }
         // some non-empty fields need addtiional validation. handle that here
         if (!empty($value)) {
             // cycle through the rules
             if (isset($field['validate'])) {
                 foreach ($field['validate'] as $rule) {
                     // process each rule if it is in the list
                     switch ($rule) {
                         // postcodes vary from country to country
                         case 'postcode':
                             $value = strtoupper(str_replace(' ', '', $value));
                             if (!WC_Validation::is_postcode($value, $_POST[$key])) {
                                 $errors[] = __('Please enter a valid postcode/ZIP.', 'woocommerce');
                             }
                             break;
                             // phone digit count and format varies from country to country
                         // phone digit count and format varies from country to country
                         case 'phone':
                             $value = wc_format_phone_number($value);
                             if (!WC_Validation::is_phone($value)) {
                                 $errors[] = '<strong>' . $field['label'] . '</strong> ' . __('is not a valid phone number.', 'woocommerce');
                             }
                             break;
                             // validate email addresses
                         // validate email addresses
                         case 'email':
                             $value = strtolower($value);
                             if (!is_email($value)) {
                                 $errors[] = '<strong>' . $field['label'] . '</strong> ' . __('is not a valid email address.', 'woocommerce');
                             }
                             break;
                             // states cound be in different formats or have different values based on the country
                         // states cound be in different formats or have different values based on the country
                         case 'state':
                             $states = WC()->countries->get_states(self::_get_value('_billing_country', $order));
                             if (!empty($states) && is_array($states)) {
                                 $states = array_flip(array_map('strtolower', $states));
                                 // look up correct value if key exists
                                 if (isset($states[strtolower($value)])) {
//.........这里部分代码省略.........
开发者ID:galapas,项目名称:opentickets-community,代码行数:101,代码来源:admin.class.php


示例16: dhvc_form_print_js_declaration

function dhvc_form_print_js_declaration()
{
    global $dhvc_form_js_declaration;
    if (!empty($dhvc_form_js_declaration)) {
        echo "<script type=\"text/javascript\">\n";
        // Sanitize
        $dhvc_form_js_declaration = wp_check_invalid_utf8($dhvc_form_js_declaration);
        $dhvc_form_js_declaration = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", $dhvc_form_js_declaration);
        $dhvc_form_js_declaration = str_replace("\r", '', $dhvc_form_js_declaration);
        echo $dhvc_form_js_declaration . "\n</script>\n";
        unset($dhvc_form_js_declaration);
    }
    return false;
}
开发者ID:polaris610,项目名称:medicalhound,代码行数:14,代码来源:functions.php


示例17: sanitize_posted_data

 private function sanitize_posted_data($value)
 {
     if (is_array($value)) {
         $value = array_map(array($this, 'sanitize_posted_data'), $value);
     } elseif (is_string($value)) {
         $value = wp_check_invalid_utf8($value);
         $value = wp_kses_no_null($value);
     }
     return $value;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:10,代码来源:submission.php


示例18: weaverii_filter_code

function weaverii_filter_code($text)
{
    static $weaverii_allowedadmintags = array('address' => array(), 'a' => array('class' => array(), 'href' => array(), 'id' => array(), 'title' => array(), 'rel' => array(), 'rev' => array(), 'name' => array(), 'target' => array()), 'abbr' => array('class' => array(), 'title' => array()), 'acronym' => array('title' => array()), 'article' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'aside' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'b' => array(), 'big' => array(), 'blockquote' => array('id' => array(), 'cite' => array(), 'class' => array(), 'lang' => array(), 'xml:lang' => array()), 'br' => array('class' => array()), 'button' => array('disabled' => array(), 'name' => array(), 'type' => array(), 'value' => array()), 'caption' => array('align' => array(), 'class' => array()), 'cite' => array('class' => array(), 'dir' => array(), 'lang' => array(), 'title' => array()), 'code' => array('style' => array()), 'col' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'span' => array(), 'dir' => array(), 'style' => array(), 'valign' => array(), 'width' => array()), 'del' => array('datetime' => array()), 'dd' => array(), 'details' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'open' => array(), 'style' => array(), 'xml:lang' => array()), 'div' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'dl' => array(), 'dt' => array(), 'em' => array(), 'fieldset' => array(), 'figure' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'figcaption' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'font' => array('color' => array(), 'face' => array(), 'size' => array()), 'footer' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'form' => array('action' => array(), 'accept' => array(), 'accept-charset' => array(), 'enctype' => array(), 'method' => array(), 'name' => array(), 'target' => array()), 'h1' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'h2' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'h3' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'h4' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'h5' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'h6' => array('align' => array(), 'class' => array(), 'id' => array(), 'style' => array()), 'header' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'hr' => array('align' => array(), 'class' => array(), 'noshade' => array(), 'size' => array(), 'width' => array()), 'i' => array(), 'img' => array('alt' => array(), 'align' => array(), 'border' => array(), 'class' => array(), 'height' => array(), 'hspace' => array(), 'longdesc' => array(), 'vspace' => array(), 'src' => array(), 'style' => array(), 'width' => array()), 'ins' => array('datetime' => array(), 'cite' => array()), 'kbd' => array(), 'label' => array('for' => array()), 'legend' => array('align' => array()), 'li' => array('align' => array(), 'class' => array()), 'link' => array(), 'menu' => array('class' => array(), 'style' => array(), 'type' => array()), 'meta' => array(), 'nav' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'p' => array('class' => array(), 'align' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'pre' => array('style' => array(), 'width' => array()), 'q' => array('cite' => array()), 's' => array(), 'span' => array('class' => array(), 'dir' => array(), 'align' => array(), 'lang' => array(), 'style' => array(), 'title' => array(), 'xml:lang' => array()), 'section' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'strike' => array(), 'strong' => array(), 'style' => array(), 'sub' => array(), 'summary' => array('align' => array(), 'class' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array()), 'sup' => array(), 'table' => array('align' => array(), 'bgcolor' => array(), 'border' => array(), 'cellpadding' => array(), 'cellspacing' => array(), 'class' => array(), 'dir' => array(), 'id' => array(), 'rules' => array(), 'style' => array(), 'summary' => array(), 'width' => array()), 'tbody' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'valign' => array()), 'td' => array('abbr' => array(), 'align' => array(), 'axis' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'class' => array(), 'colspan' => array(), 'dir' => array(), 'headers' => array(), 'height' => array(), 'nowrap' => array(), 'rowspan' => array(), 'scope' => array(), 'style' => array(), 'valign' => array(), 'width' => array()), 'textarea' => array('cols' => array(), 'rows' => array(), 'disabled' => array(), 'name' => array(), 'readonly' => array()), 'tfoot' => array('align' => array(), 'char' => array(), 'class' => array(), 'charoff' => array(), 'valign' => array()), 'th' => array('abbr' => array(), 'align' => array(), 'axis' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'class' => array(), 'colspan' => array(), 'headers' => array(), 'height' => array(), 'nowrap' => array(), 'rowspan' => array(), 'scope' => array(), 'valign' => array(), 'width' => array()), 'thead' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'class' => array(), 'valign' => array()), 'title' => array(), 'tr' => array('align' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'class' => array(), 'style' => array(), 'valign' => array()), 'tt' => array(), 'u' => array(), 'ul' => array('class' => array(), 'style' => array(), 'type' => array()), 'ol' => array('class' => array(), 'start' => array(), 'style' => array(), 'type' => array()), 'var' => array());
    // virtually all option input from Weaver II can be code, and thus must not be
    // content filtered. The utf8 check is about the extent of it, although even
    // that is more restrictive than the standard text widget uses.
    // Note: this check also works OK for simple checkboxes/radio buttons/selections,
    // so it is ok to blindly pass those options in here, too.
    $noslash = trim(stripslashes($text));
    if ($noslash == ' ') {
        return '';
    }
    if (current_user_can('unfiltered_html')) {
        return wp_check_invalid_utf8($noslash);
    } else {
        if (current_user_can('add_users')) {
            return wp_kses($text, $weaverii_allowedadmintags);
        } else {
            return stripslashes(wp_filter_post_kses(addslashes($text)));
            // wp_filter_post_kses() expects slashed
        }
    }
}
开发者ID:mystified7545,项目名称:MyBlog,代码行数:23,代码来源:lib-runtime.php


示例19: ci_print_inline_js

 /**
  * Prints the inline JS scripts that are registered for printing, and removes them from the queue.
  */
 function ci_print_inline_js()
 {
     global $ci_glob_inline_js;
     if (empty($ci_glob_inline_js)) {
         return;
     }
     $sanitized = array();
     foreach ($ci_glob_inline_js as $handle => $script) {
         $sanitized[$handle] = wp_check_invalid_utf8($script);
     }
     echo '<script type="text/javascript">' . "\n";
     echo "\t" . 'jQuery(document).ready(function($){' . "\n";
     foreach ($sanitized as $handle => $script) {
         echo "\n/* --- CI Theme Inline script ({$handle}) --- */\n";
         echo $script;
     }
     echo "\t" . '});' . "\n";
     echo '</script>' . "\n";
     $ci_glob_inline_js = array();
 }
开发者ID:sbhambad,项目名称:TimousDemo,代码行数:23,代码来源:generic.php


示例20: learn_press_print_script

/**
 * Print out js code in the queue
 */
function learn_press_print_script()
{
    global $learn_press_queued_js, $learn_press_queued_js_tag;
    if (!empty($learn_press_queued_js)) {
        echo "<!-- LearnPress JavaScript -->\n<script type=\"text/javascript\">\njQuery(function(\$) {\n";
        // Sanitize
        $learn_press_queued_js = wp_check_invalid_utf8($learn_press_queued_js);
        $learn_press_queued_js = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", $learn_press_queued_js);
        $learn_press_queued_js = str_replace("\r", '', $learn_press_queued_js);
        echo $learn_press_queued_js . "\n});\n</script>\n";
        unset($learn_press_queued_js);
    }
    if (!empty($learn_press_queued_js_tag)) {
        echo $learn_press_queued_js_tag;
    }
}
开发者ID:arshanam,项目名称:LearnPress,代码行数:19,代码来源:lpr-course-functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_check_mysql_version函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_check_filetype_and_ext函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap