Changeset 1178 in ExiteCMS


Ignore:
Timestamp:
12/21/07 10:48:52 (4 years ago)
Author:
hverton
Message:

modified the 404 handler to support both "ErrorDocument 404" and mod_rewrite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/404handler.php

    r1177 r1178  
    1818 
    1919// requested url 
    20 $url = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : ""; 
     20$url = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['SCRIPT_URL']; 
    2121 
    2222// check if we have a redirect for this URL 
    23 $result = dbquery("SELECT * from ".$db_prefix."redirects WHERE url_from = '".$_SERVER['REDIRECT_URL']."'"); 
     23$result = dbquery("SELECT * from ".$db_prefix."redirects WHERE url_from = '".((isset($_SERVER['REDIRECT_URL']) && $_SERVER['REDIRECT_URL'] != "") ? $_SERVER['REDIRECT_URL'] : $_SERVER['SCRIPT_URL'])."'"); 
    2424 
    2525// if we had a URL, and found a redirect, compose the URL to redirect to 
     
    7373    } else { 
    7474        // check for post variables 
    75         $rawpostvars = explode("&", file_get_contents("php://input")); 
    76         if (is_array($rawpostvars)) { 
     75        $rawpostvars = file_get_contents("php://input"); 
     76        if (!empty($rawpostvars)) { 
     77            $rawpostvars = explode("&", $rawpostvars); 
    7778            foreach($rawpostvars as $postvar) { 
    7879                $postvar = explode("=", $postvar); 
Note: See TracChangeset for help on using the changeset viewer.