| 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 | |
|---|
| | 54 | foreach ($pages_to_exclude as $exclude) { |
|---|
| | 55 | if (strstr(str_to_lower($_SERVER['REQUEST_URI']), $exclude)) { |
|---|
| | 56 | $redirect = false; |
|---|
| | 57 | } |
|---|
| | 58 | } |
|---|
| | 59 | |
|---|
| | 60 | if ($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(); |
|---|