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
7c5d1bd1
Commit
7c5d1bd1
authored
Sep 11, 2011
by
Dries
Browse files
- Patch
#1260162
by michaellenahan, Bès: hook_file_insert() doc has no function body.
parent
1d3b16fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/system/system.api.php
View file @
7c5d1bd1
...
...
@@ -2627,17 +2627,21 @@ function hook_file_presave($file) {
/**
* Respond to a file being added.
*
* This hook is called
before
a file has been added to the database. The hook
* This hook is called
after
a file has been added to the database. The hook
* doesn't distinguish between files created as a result of a copy or those
* created by an upload.
*
* @param $file
* The file that
is about to be sav
ed.
* The file that
has been add
ed.
*
* @see file_save()
*/
function
hook_file_insert
(
$file
)
{
// Add a message to the log, if the file is a jpg
$validate
=
file_validate_extensions
(
$file
,
'jpg'
);
if
(
empty
(
$validate
))
{
watchdog
(
'file'
,
'A jpg has been added.'
);
}
}
/**
...
...
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