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


PHP PageUrl::reencodeParametersArray方法代码示例

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


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

示例1: reencodeParameters

 /**
  * Checks if query parameters are of a non-UTF-8 encoding and converts the values
  * from the specified encoding to UTF-8.
  * This method is used to workaround browser/webapp bugs (see #3450). When
  * browsers fail to encode query parameters in UTF-8, the tracker will send the
  * charset of the page viewed and we can sometimes work around invalid data
  * being stored.
  *
  * @param array $queryParameters Name/value mapping of query parameters.
  * @param bool|string $encoding of the HTML page the URL is for. Used to workaround
  *                                      browser bugs & mis-coded webapps. See #3450.
  *
  * @return array
  */
 public static function reencodeParameters(&$queryParameters, $encoding = false)
 {
     if (function_exists('mb_check_encoding')) {
         // if query params are encoded w/ non-utf8 characters (due to browser bug or whatever),
         // encode to UTF-8.
         if (strtolower($encoding) != 'utf-8' && $encoding != false) {
             Common::printDebug("Encoding page URL query parameters to {$encoding}.");
             $queryParameters = PageUrl::reencodeParametersArray($queryParameters, $encoding);
         }
     } else {
         Common::printDebug("Page charset supplied in tracking request, but mbstring extension is not available.");
     }
     return $queryParameters;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:28,代码来源:PageUrl.php

示例2: reencodeParameters

 /**
  * Checks if query parameters are of a non-UTF-8 encoding and converts the values
  * from the specified encoding to UTF-8.
  * This method is used to workaround browser/webapp bugs (see #3450). When
  * browsers fail to encode query parameters in UTF-8, the tracker will send the
  * charset of the page viewed and we can sometimes work around invalid data
  * being stored.
  *
  * @param array $queryParameters Name/value mapping of query parameters.
  * @param bool|string $encoding of the HTML page the URL is for. Used to workaround
  *                                      browser bugs & mis-coded webapps. See #3450.
  *
  * @return array
  */
 public static function reencodeParameters(&$queryParameters, $encoding = false)
 {
     // if query params are encoded w/ non-utf8 characters (due to browser bug or whatever),
     // encode to UTF-8.
     if (false !== $encoding && 'utf-8' != strtolower($encoding) && function_exists('mb_check_encoding')) {
         $queryParameters = PageUrl::reencodeParametersArray($queryParameters, $encoding);
     }
     return $queryParameters;
 }
开发者ID:TensorWrenchOSS,项目名称:piwik,代码行数:23,代码来源:PageUrl.php


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