Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
2347d3f9
Commit
2347d3f9
authored
Mar 30, 2006
by
Gerhard Killesreiter
Browse files
#53834
, validation was broken in blogapi, patch by samc
parent
6ad02345
Changes
2
Show whitespace changes
Inline
Side-by-side
modules/blogapi.module
View file @
2347d3f9
...
...
@@ -214,11 +214,6 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
$edit
[
'body'
]
=
$content
;
}
node_validate
(
$edit
);
if
(
$errors
=
form_get_errors
())
{
return
blogapi_error
(
implode
(
"
\n
"
,
$errors
));
}
if
(
!
node_access
(
'create'
,
$node
))
{
return
blogapi_error
(
t
(
'You do not have permission to create the type of post you wanted to create.'
));
}
...
...
@@ -226,6 +221,12 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
if
(
user_access
(
'administer nodes'
)
&&
!
isset
(
$edit
[
'date'
]))
{
$edit
[
'date'
]
=
format_date
(
time
(),
'custom'
,
'Y-m-d H:i:s O'
);
}
node_validate
(
$edit
);
if
(
$errors
=
form_get_errors
())
{
return
blogapi_error
(
implode
(
"
\n
"
,
$errors
));
}
$node
=
node_submit
(
$edit
);
node_save
(
$node
);
if
(
$node
->
nid
)
{
...
...
modules/blogapi/blogapi.module
View file @
2347d3f9
...
...
@@ -214,11 +214,6 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
$edit
[
'body'
]
=
$content
;
}
node_validate
(
$edit
);
if
(
$errors
=
form_get_errors
())
{
return
blogapi_error
(
implode
(
"
\n
"
,
$errors
));
}
if
(
!
node_access
(
'create'
,
$node
))
{
return
blogapi_error
(
t
(
'You do not have permission to create the type of post you wanted to create.'
));
}
...
...
@@ -226,6 +221,12 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
if
(
user_access
(
'administer nodes'
)
&&
!
isset
(
$edit
[
'date'
]))
{
$edit
[
'date'
]
=
format_date
(
time
(),
'custom'
,
'Y-m-d H:i:s O'
);
}
node_validate
(
$edit
);
if
(
$errors
=
form_get_errors
())
{
return
blogapi_error
(
implode
(
"
\n
"
,
$errors
));
}
$node
=
node_submit
(
$edit
);
node_save
(
$node
);
if
(
$node
->
nid
)
{
...
...
Write
Preview
Supports
Markdown
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