Changeset 47632 in spip-zone


Ignore:
Timestamp:
May 10, 2011, 11:21:09 AM (10 years ago)
Author:
brunobergot@…
Message:

on utilise une ruse de fil pour donner une url plus sympa au service oembed

Location:
_plugins_/oembed
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/oembed/oembed_options.php

    r47462 r47632  
    33define('_DEFINIR_CONTEXTE_TYPE',true);
    44
     5// intercepter les appels à l'url /services/oembed/ (merci fil)
     6if (preg_match(',/services/(oembed)/,', $_SERVER['REQUEST_URI'], $r)
     7        AND $GLOBALS['profondeur_url']==2) {
     8                set_request('page', $r[1]);
     9}
     10
    511?>
  • _plugins_/oembed/oembed_pipelines.php

    r47599 r47632  
    44function oembed_affichage_final($page) {
    55        if (!$GLOBALS['html']) return $page;
    6 
    7         if ($url_oembed = url_absolue(parametre_url(generer_url_public('oembed'),'url',url_absolue(self())))) {
     6        if ($url_oembed = url_absolue(parametre_url($GLOBALS['meta']['adresse_site'] . '/services/oembed/','url',url_absolue(self())))) {
    87                $page = preg_replace(',</head>,i',
    98                        "\n".'<link rel="alternate" type="application/json+oembed" href="'.$url_oembed.'&format=json" />'.
Note: See TracChangeset for help on using the changeset viewer.