Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
b3dae716
Commit
b3dae716
authored
Nov 21, 2006
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#98293
by Steven: remove restrictions on path aliases.
parent
8996aad9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
includes/common.inc
includes/common.inc
+3
-0
modules/path/path.module
modules/path/path.module
+1
-12
No files found.
includes/common.inc
View file @
b3dae716
...
...
@@ -702,6 +702,9 @@ function valid_email_address($mail) {
/**
* Verify the syntax of the given URL.
*
* This function should only be used on actual URLs. It should not be used for
* Drupal menu paths, which can contain arbitrary characters.
*
* @param $url
* The URL to verify.
* @param $absolute
...
...
modules/path/path.module
View file @
b3dae716
...
...
@@ -224,10 +224,7 @@ function path_nodeapi(&$node, $op, $arg) {
switch
(
$op
)
{
case
'validate'
:
$node
->
path
=
trim
(
$node
->
path
);
if
(
$node
->
path
&&
!
valid_url
(
$node
->
path
))
{
form_set_error
(
'path'
,
t
(
'The path is invalid.'
));
}
else
if
(
db_result
(
db_query
(
"SELECT COUNT(dst) FROM
{
url_alias
}
WHERE dst = '%s' AND src != '%s'"
,
$node
->
path
,
"node/
$node->nid
"
)))
{
if
(
db_result
(
db_query
(
"SELECT COUNT(dst) FROM
{
url_alias
}
WHERE dst = '%s' AND src != '%s'"
,
$node
->
path
,
"node/
$node->nid
"
)))
{
form_set_error
(
'path'
,
t
(
'The path is already in use.'
));
}
break
;
...
...
@@ -345,14 +342,6 @@ function path_form_validate($form_id, $form_values) {
$dst
=
$form_values
[
'dst'
];
$pid
=
$form_values
[
'pid'
];
if
(
!
valid_url
(
$src
))
{
form_set_error
(
'src'
,
t
(
'The system path %path is invalid.'
,
array
(
'%path'
=>
$src
)));
}
if
(
!
valid_url
(
$dst
))
{
form_set_error
(
'dst'
,
t
(
'The alias %alias is invalid.'
,
array
(
'%alias'
=>
$dst
)));
}
if
(
db_result
(
db_query
(
"SELECT COUNT(dst) FROM
{
url_alias
}
WHERE pid != %d AND dst = '%s'"
,
$pid
,
$dst
)))
{
form_set_error
(
'dst'
,
t
(
'The alias %alias is already in use.'
,
array
(
'%alias'
=>
$dst
)));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment