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