summaryrefslogtreecommitdiff
path: root/modules/system/system.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-09-11 17:46:06 -0400
committerDries Buytaert <dries@buytaert.net>2011-09-11 17:46:06 -0400
commitb30fae020a3cf13ce6854d2549d031afae01e7e4 (patch)
treef69ec5a4638403369ab536a532eedf2b52c6dd55 /modules/system/system.api.php
parentc8334a088ff96ff23b6f4f5f887b4b2bfc35f03e (diff)
downloadbrdo-b30fae020a3cf13ce6854d2549d031afae01e7e4.tar.gz
brdo-b30fae020a3cf13ce6854d2549d031afae01e7e4.tar.bz2
- Patch #1260162 by michaellenahan, Bès: hook_file_insert() doc has no function body.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r--modules/system/system.api.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 3c18f176e..7b07736fe 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -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 saved.
+ * The file that has been added.
*
* @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.');
+ }
}
/**