Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
redir.php
r184 r316 4 4 $userdata = session_pagestart($user_ip); 5 5 init_userprefs($userdata); 6 6 7 $url = ''; 7 8 8 while (list($var,$val) = each($_GET)) {9 foreach( $_GET AS $var => $val ) { 9 10 $url .= "&$var=$val"; 10 11 } 12 11 13 $i = strpos($url, "&url="); 12 14 13 if ( $i !== false) {14 $url = substr($url, $i + 5);15 if ( $i !== false ) { 16 $url = substr($url, $i + 5); 15 17 } 18 16 19 if (substr($url, 0, 4) == "www.") { 17 $url = "http://" . $url;20 $url = "http://" . $url; 18 21 } 22 23 if ( strpos($url, '?') !== false ) { 24 $args = explode('?', $url); 25 $_url = $args[0] . '?'; 26 unset($args[0]); 27 28 if ( strpos($url, '&') !== false ) { 29 $args = explode('&',$args[1]); 30 } 31 32 $new_args = ''; 33 34 foreach ( $args AS $_null => $arg ) { 35 list($key, $val) = explode('=',$arg); 36 37 $new_args .= ( $new_args ? '&' : '' ) . $key . '=' . urlencode($val); 38 } 39 40 $url = $_url . $new_args; 41 } 42 19 43 if (strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r")) { 20 44 trigger_error('Tried to redirect to potentially insecure url.');
