From b30fae020a3cf13ce6854d2549d031afae01e7e4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 11 Sep 2011 17:46:06 -0400 Subject: =?UTF-8?q?-=20Patch=20#1260162=20by=20michaellenahan,=20B=C3=A8s:?= =?UTF-8?q?=20hook=5Ffile=5Finsert()=20doc=20has=20no=20function=20body.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/system/system.api.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'modules/system/system.api.php') 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.'); + } } /** -- cgit v1.2.3