Menu

redirect_header() : support URL fragment

okuhiki
2007-06-20
2013-04-25
  • okuhiki

    okuhiki - 2007-06-20

    redirect_header() : support URL fragment(anchor)

    original (/include/functions.php Line 419 - 424)
    [code]
    if (!strstr($url, '?')) {
        $url .= '?xoops_redirect='.urlencode($xoopsRequestUri);
    } else {
        $url .= '&xoops_redirect='.urlencode($xoopsRequestUri);
    }
    [/code]

    uncertainty
    [code]
    if (!strstr($url, '#')) {
        if (!strstr($url, '?')) {
            $url .= '?xoops_redirect=' . urlencode($xoopsRequestUri);
        } else {
            $url .= '&xoops_redirect=' . urlencode($xoopsRequestUri);
        }
    } else {
        if (!strstr($url, '?')) {
            $url = str_replace('#', '?xoops_redirect=' . urlencode($xoopsRequestUri) . '#', $url);
        } else {
            $url = str_replace('#', '&xoops_redirect=' . urlencode($xoopsRequestUri) . '#', $url);
        }
    }
    [/code]

    SID
    original (/include/functions.php Line 426 - 432)
    [code]
    if (!strstr($url, '?')) {
        $url .= '?' . SID;
    }
    else {
        $url .= '&'.SID;
    }
    [/code]

    uncertainty
    [code]
    if (!strstr($url, '#')) {
        if (!strstr($url, '?')) {
            $url .= '?' . SID;
        } else {
            $url .= '&' . SID;
        }
    } else {
        if (!strstr($url, '?')) {
            $url = str_replace('#', '?' . SID .'#', $url);
        } else {
            $url = str_replace('#', '&' . SID . '#', $url);
        }
    }
    [/code]

    Example 1
    $url = 'http://xoopscube.org/index.php#mainmenu';

    original
      $url is
        'http://xoopscube.org/index.php#mainmenu?xoops_redirect=ReqUri&SID=SID'
    uncertainty
      $url is
        'http://xoopscube.org/index.php?xoops_redirect=ReqUri&SID=SID#mainmenu'

    Example 2
    $url = 'http://xoopscube.org/index.php?ex=Example#mainmenu';

    original
      $url is
        'http://xoopscube.org/index.php?ex=Example#mainmenu&xoops_redirect=ReqUri&SID=SID'
    uncertainty
      $url is
        'http://xoopscube.org/index.php?ex=Example&xoops_redirect=ReqUri&SID=SID#mainmenu'

     
    • minahito

      minahito - 2007-06-22

      Shall we discuss about it in 'Developers - Legacy', not this form? (^^;

      This forum is "About managing the project on sf.net"...Sorry.

      (I've tried move this topic to the Legacy forum, but it was impossible)

       
      • okuhiki

        okuhiki - 2007-06-24

        I'm sorry the contribution to an improper forum.
        The outline of each forum was not understood.

         

Log in to post a comment.