Piwik\Common::unsanitizeInputValue PHP Méthode

unsanitizeInputValue() public static méthode

Unsanitizes a single input value and returns the result.
public static unsanitizeInputValue ( string $value ) : string
$value string
Résultat string unsanitized input
    public static function unsanitizeInputValue($value)
    {
        return htmlspecialchars_decode($value, self::HTML_ENCODING_QUOTE_STYLE);
    }

Usage Example

Exemple #1
0
 /**
  * The constructor
  * Initialize some local variables from the request
  * @param int $idSite
  * @param Date $date ($this->date from controller)
  * @param null|string $graphType
  * @throws Exception
  */
 public function __construct($idSite, $date, $graphType = 'graphEvolution')
 {
     $this->apiMethod = Common::getRequestVar('apiMethod', '', 'string');
     if (empty($this->apiMethod)) {
         throw new Exception("Parameter apiMethod not set.");
     }
     $this->label = DataTablePostProcessor::getLabelFromRequest($_GET);
     if (!is_array($this->label)) {
         throw new Exception("Expected label to be an array, got instead: " . $this->label);
     }
     $this->label = Common::unsanitizeInputValue($this->label[0]);
     if ($this->label === '') {
         throw new Exception("Parameter label not set.");
     }
     $this->period = Common::getRequestVar('period', '', 'string');
     PeriodFactory::checkPeriodIsEnabled($this->period);
     $this->idSite = $idSite;
     $this->graphType = $graphType;
     if ($this->period != 'range') {
         // handle day, week, month and year: display last X periods
         $end = $date->toString();
         list($this->date, $lastN) = EvolutionViz::getDateRangeAndLastN($this->period, $end);
     }
     $this->segment = \Piwik\API\Request::getRawSegmentFromRequest();
     $this->loadEvolutionReport();
 }
All Usage Examples Of Piwik\Common::unsanitizeInputValue