|
From: FlorinCB <ory...@us...> - 2009-07-11 02:55:51
|
Update of /cvsroot/mxbb/mx_radiocast/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17921/includes Modified Files: radiocast_add.php radiocast_edit.php Log Message: upd Index: radiocast_add.php =================================================================== RCS file: /cvsroot/mxbb/mx_radiocast/includes/radiocast_add.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** radiocast_add.php 11 Jul 2009 01:37:52 -0000 1.3 --- radiocast_add.php 11 Jul 2009 02:55:44 -0000 1.4 *************** *** 326,330 **** --- 326,333 ---- $station_url = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['station_url']))); + //Image Edit Added by OryNider $image_system = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['image_system']))); + + $station_imgurl = str_replace("\'", "''", htmlspecialchars(trim($HTTP_POST_VARS['station_imgurl']))); $station_desc = str_replace("\'", "''", htmlspecialchars(substr(trim($HTTP_POST_VARS['station_desc']), 0, $radiocast_config['desc_length']))); *************** *** 452,691 **** if( empty($station_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! // End extra ! default: ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } } else { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! default: ! $station_filetype = '.pls'; ! break; ! // End extra ! } } --- 455,694 ---- if( empty($station_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! // End extra ! default: ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } } else { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! default: ! $station_filetype = '.pls'; ! break; ! // End extra ! } } *************** *** 694,698 **** // Generate filename // -------------------------------- - srand((double)microtime()*1000000); // for older than version 4.2.0 of PHP --- 697,700 ---- *************** *** 716,720 **** else { ! $station_imagename = ''; } --- 718,722 ---- else { ! $station_imagename = $station_imgurl ? $station_imgurl : ($old_pic_filename ? $old_pic_filename : ''); } Index: radiocast_edit.php =================================================================== RCS file: /cvsroot/mxbb/mx_radiocast/includes/radiocast_edit.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** radiocast_edit.php 11 Jul 2009 01:46:56 -0000 1.4 --- radiocast_edit.php 11 Jul 2009 02:55:44 -0000 1.5 *************** *** 284,288 **** // Check image type // -------------------------------- ! if($station_image) { switch ($imagetype) --- 284,288 ---- // Check image type // -------------------------------- ! if($image_system == '1') { switch ($imagetype) *************** *** 371,377 **** if ( ($image_width > $radiocast_config['max_image_width']) or ($image_height > $radiocast_config['max_image_height']) ) { ! @unlink($station_image_path . $station_imagename); ! mx_message_die(GENERAL_ERROR, 'Your uploaded image size is too big'); } } --- 371,377 ---- if ( ($image_width > $radiocast_config['max_image_width']) or ($image_height > $radiocast_config['max_image_height']) ) { ! @unlink($station_image_path . $station_imagename); ! mx_message_die(GENERAL_ERROR, 'Your uploaded image size is too big'); } } |