### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
1389 | 1389 | */ |
1390 | 1390 | function add_query_arg() { |
1391 | 1391 | $ret = ''; |
| 1392 | |
| 1393 | // reduce path in REQUEST_URI for auto-URIs. |
| 1394 | // Ticket #16932 |
| 1395 | $request = $_SERVER['REQUEST_URI']; |
| 1396 | ( ( $query = (string) strstr($request, '?') ) || true) |
| 1397 | && '.php' === substr( $request, -strlen($query) - 4, -strlen($query) ) |
| 1398 | && $request = basename( $request ) |
| 1399 | ; |
| 1400 | |
1392 | 1401 | if ( is_array( func_get_arg(0) ) ) { |
1393 | 1402 | if ( @func_num_args() < 2 || false === @func_get_arg( 1 ) ) |
1394 | | $uri = $_SERVER['REQUEST_URI']; |
| 1403 | $uri = $request; |
1395 | 1404 | else |
1396 | 1405 | $uri = @func_get_arg( 1 ); |
1397 | 1406 | } else { |
1398 | 1407 | if ( @func_num_args() < 3 || false === @func_get_arg( 2 ) ) |
1399 | | $uri = $_SERVER['REQUEST_URI']; |
| 1408 | $uri = $request; |
1400 | 1409 | else |
1401 | 1410 | $uri = @func_get_arg( 2 ); |
1402 | 1411 | } |