Changeset 428

Show
Ignore:
Timestamp:
01/18/05 17:41:14 (3 years ago)
Author:
aking
Message:

don't redirect when posting comments, mail.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wordpress-mobile-edition/trunk/wp-mobile.plugin.php

    r291 r428  
    22 
    33// WordPress Mobile Edition 
    4 // version 1.7, 2005-01-12 
     4// version 1.8b, 2005-01-18 
    55// 
    66// Copyright (c) 2002-2005 Alex King 
     
    4545                                 ); 
    4646 
    47 foreach ($small_browsers as $browser) { 
    48       if (strstr($_SERVER["HTTP_USER_AGENT"], $browser) && !strstr($_SERVER['REQUEST_URI'], 'wp-mobile.php')) { 
    49             $URL = get_settings('siteurl').'/wp-mobile.php?'; 
    50             if (isset($p)) { 
    51                   $URL .= 'p='.$p.'&'; 
     47$pages_to_exclude = array('wp-mobile.php' 
     48                         ,'wp-comments-post.php' 
     49                         ,'wp-mail.php' 
     50                         ); 
     51 
     52$redirect = true; 
     53 
     54foreach ($pages_to_exclude as $exclude) { 
     55      if (strstr(str_to_lower($_SERVER['REQUEST_URI']), $exclude)) { 
     56            $redirect = false; 
     57      } 
     58
     59 
     60if ($redirect) { 
     61      foreach ($small_browsers as $browser) { 
     62            if (strstr($_SERVER["HTTP_USER_AGENT"], $browser) && !strstr($_SERVER['REQUEST_URI'], 'wp-mobile.php')) { 
     63                  $URL = get_settings('siteurl').'/wp-mobile.php?'; 
     64                  if (isset($p)) { 
     65                        $URL .= 'p='.$p.'&'; 
     66                  } 
     67                  if (isset($m)) { 
     68                        $URL .= 'm='.$m.'&'; 
     69                  } 
     70                  if (isset($cat)) { 
     71                        $URL .= 'cat='.$cat.'&'; 
     72                  } 
     73                  header("Location: $URL"); 
     74                  die(); 
    5275            } 
    53             if (isset($m)) { 
    54                   $URL .= 'm='.$m.'&'; 
    55             } 
    56             if (isset($cat)) { 
    57                   $URL .= 'cat='.$cat.'&'; 
    58             } 
    59             header("Location: $URL"); 
    60             die(); 
    6176      } 
    6277}