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


PHP Common::unsanitizeInputValues方法代码示例

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


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

示例1: getCustomVariables

 public function getCustomVariables($scope)
 {
     if ($scope == 'visit') {
         $parameter = '_cvar';
     } else {
         $parameter = 'cvar';
     }
     $customVar = Common::unsanitizeInputValues(Common::getRequestVar($parameter, '', 'json', $this->params));
     if (!is_array($customVar)) {
         return array();
     }
     $customVariables = array();
     foreach ($customVar as $id => $keyValue) {
         $id = (int) $id;
         if ($id < 1 || $id > Tracker::MAX_CUSTOM_VARIABLES || count($keyValue) != 2 || !is_string($keyValue[0]) && !is_numeric($keyValue[0])) {
             Common::printDebug("Invalid custom variables detected (id={$id})");
             continue;
         }
         if (strlen($keyValue[1]) == 0) {
             $keyValue[1] = "";
         }
         // We keep in the URL when Custom Variable have empty names
         // and values, as it means they can be deleted server side
         $key = self::truncateCustomVariable($keyValue[0]);
         $value = self::truncateCustomVariable($keyValue[1]);
         $customVariables['custom_var_k' . $id] = $key;
         $customVariables['custom_var_v' . $id] = $value;
     }
     return $customVariables;
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:30,代码来源:Request.php

示例2: getJavascriptTag

 /**
  * Returns the javascript tag for the given idSite.
  * This tag must be included on every page to be tracked by Piwik
  *
  * @param int $idSite
  * @param string $piwikUrl
  * @param bool $mergeSubdomains
  * @param bool $groupPageTitlesByDomain
  * @param bool $mergeAliasUrls
  * @param bool $visitorCustomVariables
  * @param bool $pageCustomVariables
  * @param bool $customCampaignNameQueryParam
  * @param bool $customCampaignKeywordParam
  * @param bool $doNotTrack
  * @param bool $disableCookies
  * @return string The Javascript tag ready to be included on the HTML pages
  */
 public function getJavascriptTag($idSite, $piwikUrl = '', $mergeSubdomains = false, $groupPageTitlesByDomain = false, $mergeAliasUrls = false, $visitorCustomVariables = false, $pageCustomVariables = false, $customCampaignNameQueryParam = false, $customCampaignKeywordParam = false, $doNotTrack = false, $disableCookies = false)
 {
     Piwik::checkUserHasViewAccess($idSite);
     if (empty($piwikUrl)) {
         $piwikUrl = SettingsPiwik::getPiwikUrl();
     }
     // Revert the automatic encoding
     // TODO remove that when https://github.com/piwik/piwik/issues/4231 is fixed
     $piwikUrl = Common::unsanitizeInputValue($piwikUrl);
     $visitorCustomVariables = Common::unsanitizeInputValues($visitorCustomVariables);
     $pageCustomVariables = Common::unsanitizeInputValues($pageCustomVariables);
     $customCampaignNameQueryParam = Common::unsanitizeInputValue($customCampaignNameQueryParam);
     $customCampaignKeywordParam = Common::unsanitizeInputValue($customCampaignKeywordParam);
     $generator = new TrackerCodeGenerator();
     $code = $generator->generate($idSite, $piwikUrl, $mergeSubdomains, $groupPageTitlesByDomain, $mergeAliasUrls, $visitorCustomVariables, $pageCustomVariables, $customCampaignNameQueryParam, $customCampaignKeywordParam, $doNotTrack, $disableCookies);
     $code = str_replace(array('<br>', '<br />', '<br/>'), '', $code);
     return $code;
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:35,代码来源:API.php

示例3: unsanitizeLabelParameter

 public static function unsanitizeLabelParameter($label)
 {
     // this is needed because Proxy uses Common::getRequestVar which in turn
     // uses Common::sanitizeInputValue. This causes the > that separates recursive labels
     // to become &gt; and we need to undo that here.
     $label = Common::unsanitizeInputValues($label);
     return $label;
 }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:8,代码来源:ResponseBuilder.php

示例4: getEcommerceItemsFromRequest

 /**
  * Returns Items read from the request string
  * @return array|bool
  */
 private function getEcommerceItemsFromRequest()
 {
     $items = $this->request->getParam('ec_items');
     if (empty($items)) {
         Common::printDebug("There are no Ecommerce items in the request");
         // we still record an Ecommerce order without any item in it
         return array();
     }
     if (!is_array($items)) {
         Common::printDebug("Error while json_decode the Ecommerce items = " . var_export($items, true));
         return false;
     }
     $items = Common::unsanitizeInputValues($items);
     $cleanedItems = $this->getCleanedEcommerceItems($items);
     return $cleanedItems;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:20,代码来源:GoalManager.php


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