Example #1
0
 /**
  * Affiche une Url formatée
  * @param $url l'url à formater définie comme un tableau :
  *                    $url['c'] = controller
  *                    $url['a'] = action
  *                    $url['params'] = tableau des paramètres supplémentaires
  *             ou comme une chaîne de caractère
  * @param $encodage pour indiquer comment encoder les & (& ou & pour html)
  * @return l'url formatée
  */
 public static function display($url = array(), $encodage = 'html', $absolute = false)
 {
     $isArray = is_array($url);
     if ($isArray) {
         $url = self::checkUrl($url);
     }
     $url_string = '';
     if ($absolute) {
         $url_string = Minz_Request::getBaseUrl(PUBLIC_TO_INDEX_PATH);
         if ($url_string === PUBLIC_TO_INDEX_PATH) {
             $url_string = Minz_Request::guessBaseUrl();
         }
     } else {
         $url_string = $isArray ? '.' : PUBLIC_RELATIVE;
     }
     if ($isArray) {
         $url_string .= self::printUri($url, $encodage);
     } elseif ($encodage === 'html') {
         $url_string = Minz_Helper::htmlspecialchars_utf8($url_string . $url);
     } else {
         $url_string .= $url;
     }
     return $url_string;
 }
Example #2
0
 /**
  * Méthode désactivant les magic_quotes pour les variables
  *   $_GET
  *   $_POST
  *   $_COOKIE
  */
 private static function magicQuotesOff()
 {
     if (get_magic_quotes_gpc()) {
         $_GET = Minz_Helper::stripslashes_r($_GET);
         $_POST = Minz_Helper::stripslashes_r($_POST);
         $_COOKIE = Minz_Helper::stripslashes_r($_COOKIE);
     }
 }
 /**
  * This method imports an OPML category element.
  *
  * @param array $cat_elt an OPML element (must be a category element).
  * @param string $parent_cat the name of the parent category.
  * @param boolean $cat_limit_reached indicates if category limit has been reached.
  *                if yes, category is not added (but we try for feeds!)
  * @return boolean true if an error occured, false else.
  */
 private function addCategoryOpml($cat_elt, $parent_cat, $cat_limit_reached)
 {
     // Create a new Category object
     $cat = new FreshRSS_Category(Minz_Helper::htmlspecialchars_utf8($cat_elt['text']));
     $error = true;
     if (!$cat_limit_reached) {
         $id = $this->catDAO->addCategoryObject($cat);
         $error = $id === false;
     }
     if (isset($cat_elt['@outlines'])) {
         // Our cat_elt contains more categories or more feeds, so we
         // add them recursively.
         // Note: FreshRSS does not support yet category arborescence
         $res = $this->addOpmlElements($cat_elt['@outlines'], $cat->name());
         if (!$error && $res) {
             $error = true;
         }
     }
     return $error;
 }