diff options
Diffstat (limited to 'attachment_uploader.php')
| -rw-r--r-- | attachment_uploader.php | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/attachment_uploader.php b/attachment_uploader.php index dc642de..193cb46 100644 --- a/attachment_uploader.php +++ b/attachment_uploader.php @@ -33,16 +33,10 @@ if ( !isset($_FILES['upload'] ) ) { // load up the requested content type handler class $contentType = $_REQUEST['liberty_attachments']['content_type_guid']; $contentTypeHash = $gLibertySystem->mContentTypes[$contentType]; - $class = $contentTypeHash['handler_class']; - $classFile = $contentTypeHash['handler_file']; - $package = $contentTypeHash['handler_package']; - $pathVar = strtoupper($package).'_PKG_PATH'; - - if( !defined( $pathVar ) ) { + if( LibertySystem::requireContentType( $contentTypeHash ) ) { + $gContent = new $contentTypeHash['handler_class'](); + } else { $error = tra( "Undefined handler package path" ); - }else{ - require_once( constant( $pathVar ).$classFile ); - $gContent = new $class(); } } }else{ |
