Commit cb0cc356 authored by jcnventura's avatar jcnventura

Issue #684178: support node/add/{nodetype} and similar paths.

parent 8747d1bd
......@@ -716,7 +716,7 @@ function print_insert_link($path = NULL, $node = NULL) {
}
else {
if ($path === NULL) {
$nid = preg_replace('!^node/!', '', $_GET['q']);
$nid = preg_replace('!^node/([\d]+)!', '$1', $_GET['q']);
$path = $_GET['q'];
}
else {
......
......@@ -80,7 +80,7 @@ function print_controller($path, $cid = NULL, $format = PRINT_HTML_FORMAT, $teas
$path = $alias;
}
$parts = explode('/', $path);
if (($parts[0] == 'node') && (count($parts) > 1)) {
if (($parts[0] == 'node') && (count($parts) > 1) && ctype_digit($parts[1])) {
array_shift($parts);
$path = implode('/', $parts);
}
......
......@@ -392,7 +392,7 @@ function print_mail_insert_link($path = NULL, $node = NULL) {
}
else {
if ($path === NULL) {
$nid = preg_replace('!^node/!', '', $_GET['q']);
$nid = preg_replace('!^node/([\d]+)!', '$1', $_GET['q']);
$path = $_GET['q'];
}
else {
......
......@@ -477,7 +477,7 @@ function print_pdf_insert_link($path = NULL, $node = NULL) {
}
else {
if ($path === NULL) {
$nid = preg_replace('!^node/!', '', $_GET['q']);
$nid = preg_replace('!^node/([\d]+)!', '$1', $_GET['q']);
$path = $_GET['q'];
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment