Changeset 9437


Ignore:
Timestamp:
Mar 1, 2011, 12:22:40 AM (9 years ago)
Author:
plg
Message:

bug fixed: the redirect on "home / level1 / level2" was applied to
"home / level1" as well

bug fixed: incompatibility with $confquestion_mark_in_urls = false,
make_index_url() or make_picture_url() care about relative path, no need to
start url with get_absolute_root_url

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/main.inc.php

    r9424 r9437  
    22/*
    33Plugin Name: Extended Description
    4 Version: 2.1.e
     4Version: auto
    55Description: Add multilinguale descriptions, banner, NMB, category name, etc...
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=175
     
    6464  global $conf, $page;
    6565
    66   if (isset($page['category']) and !isset($page['image_id']) and preg_match('#\[redirect (.*?)\]#i', $desc, $m1))
     66  if ($param == 'main_page_category_description' and isset($page['category']) and !isset($page['image_id']) and preg_match('#\[redirect (.*?)\]#i', $desc, $m1))
    6767  {
    6868    if (preg_match('#^(img|cat|search)=(\d*)\.?(\d*|)$#i', $m1[1], $m2))
    6969    {
    70       $url  = get_absolute_root_url();
    7170      switch ($m2[1])
    7271      {
     
    7776          $url_params['category'] = array('id' => $m2[3], 'name' => '', 'permalink' => '');
    7877        }
    79         $url .= rtrim(make_picture_url($url_params), '-');
     78        $url = rtrim(make_picture_url($url_params), '-');
    8079        break;
    8180
    8281        case 'cat':
    8382        $url_params = array('category' => array('id' => $m2[2], 'name' => '', 'permalink' => ''));
    84         $url .= rtrim(make_index_url($url_params), '-');
     83        $url = rtrim(make_index_url($url_params), '-');
    8584        break;
    8685
    8786        case 'search':
    88         $url .= make_index_url(array('section' => 'search', 'search' => $m2[2]));
     87        $url = make_index_url(array('section' => 'search', 'search' => $m2[2]));
    8988      }
    9089    }
Note: See TracChangeset for help on using the changeset viewer.