Question

Drupal 7

function custom_menu() {
    $items['node_update/%nid/%pic/%name'] = array (
        'title' => 'Redirecting to your profile page',
        'page callback' => custom_node_update,
        'page arguments' => array(3,4,5),
        'access callback' => TRUE,
        'type' => MENU_CALLBACK,
    );    
    return $items;
}

When i use http://myserver.com/node_update/51/sites%2fdefault%2fimages/picture.jpg/admin

so when im using %2f hook_menu somewhat still consider it as forward slash '/' therefore it somewhat recognised as this instead http://myserver.com/node_update/51/sites/default/images/picture.jpg/admin which is of course beyond the arguments i'm listening on hook_menu.

Anyone can help on this please. how to use url_encoded string as argument.

Was it helpful?

Solution

Your page arguments are not set correctly. Try to change it to be:

'page arguments' => array(1, 2, 3),

Then flash the website cache and try again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top