Changeset 93629 in spip-zone for _core_/plugins/urls_etendues/urls/html.php
- Timestamp:
- Dec 13, 2015, 11:58:52 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_core_/plugins/urls_etendues/urls/html.php
r93092 r93629 32 32 */ 33 33 34 if (!defined("_ECRIRE_INC_VERSION")) return; // securiser 34 if (!defined("_ECRIRE_INC_VERSION")) { 35 return; 36 } // securiser 35 37 36 38 # donner un exemple d'url pour le formulaire de choix … … 39 41 // http://code.spip.net/@_generer_url_html 40 42 function _generer_url_html($type, $id, $args = '', $ancre = '') { 41 if ($generer_url_externe = charger_fonction("generer_url_$type", 'urls',true)) {43 if ($generer_url_externe = charger_fonction("generer_url_$type", 'urls', true)) { 42 44 $url = $generer_url_externe($id, $args, $ancre); 43 if (NULL != $url) return $url; 45 if (null != $url) { 46 return $url; 47 } 44 48 } 45 49 46 return _DIR_RACINE . $type . $id . '.html' . ($args ? "?$args" : '') . ($ancre ? "#$ancre" : '');50 return _DIR_RACINE . $type . $id . '.html' . ($args ? "?$args" : '') . ($ancre ? "#$ancre" : ''); 47 51 } 48 52 … … 51 55 function urls_html_dist($i, $entite, $args = '', $ancre = '') { 52 56 53 if (is_numeric($i)) 57 if (is_numeric($i)) { 54 58 return _generer_url_html($entite, $i, $args, $ancre); 59 } 55 60 56 61 // recuperer les &debut_xx; 57 if (is_array($args)) 62 if (is_array($args)) { 58 63 $contexte = $args; 59 else 60 parse_str($args,$contexte); 64 } else { 65 parse_str($args, $contexte); 66 } 61 67 62 68 63 69 // traiter les injections du type domaine.org/spip.php/cestnimportequoi/ou/encore/plus/rubrique23 64 if ($GLOBALS['profondeur_url'] >0 AND $entite=='sommaire'){65 return array(array(), '404');70 if ($GLOBALS['profondeur_url'] > 0 AND $entite == 'sommaire') { 71 return array(array(), '404'); 66 72 } 67 73 … … 73 79 // il n'est pas necessaire de forcer le fond en 4eme arg car l'url n'est pas query string 74 80 // sauf si pas de fond connu 75 if ($entite) 81 if ($entite) { 76 82 array_pop($r); 83 } 84 77 85 return $r; 78 86 } … … 88 96 $url_propre = $i; 89 97 if ($url_propre) { 90 if ($GLOBALS['profondeur_url']<=0) 91 $urls_anciennes = charger_fonction('propres','urls'); 92 else 93 $urls_anciennes = charger_fonction('arbo','urls'); 98 if ($GLOBALS['profondeur_url'] <= 0) { 99 $urls_anciennes = charger_fonction('propres', 'urls'); 100 } else { 101 $urls_anciennes = charger_fonction('arbo', 'urls'); 102 } 103 94 104 return $urls_anciennes($url_propre, $entite, $contexte); 95 105 }
Note: See TracChangeset
for help on using the changeset viewer.