From ca716517676cff9e66ebd301bf771891d0cb0962 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 3 Aug 2002 23:52:33 +0000 Subject: Various updates git-svn-id: file:///svn/phpbb/trunk@2816 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_smilies.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'phpBB/admin/admin_smilies.php') diff --git a/phpBB/admin/admin_smilies.php b/phpBB/admin/admin_smilies.php index 7f212425a3..c930c3edc8 100644 --- a/phpBB/admin/admin_smilies.php +++ b/phpBB/admin/admin_smilies.php @@ -19,9 +19,6 @@ * ***************************************************************************/ -// -// First we do the setmodules stuff for the admin cp. -// if ( !empty($setmodules) ) { if ( !$acl->get_acl_admin('general') ) @@ -30,25 +27,27 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['General']['Emoticons'] = $filename . $SID . "&mode=emoticons"; + $module['General']['Emoticons'] = $filename . $SID . '&mode=emoticons'; return; } define('IN_PHPBB', 1); +// +// Include files +// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // -// +// Do we have general permissions? // if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); } - // // Check to see what mode we should operate in. // @@ -70,11 +69,11 @@ $dir = @opendir($phpbb_root_path . $board_config['smilies_path']); while( $file = @readdir($dir) ) { - if ( !is_dir($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) + if ( is_file($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) { $img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file); - if( $img_size[0] && $img_size[1] ) + if ( $img_size[0] && $img_size[1] ) { $smiley_images[] = $file; } @@ -97,14 +96,14 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // $smile_pak = ( isset($HTTP_POST_VARS['smile_pak']) ) ? $HTTP_POST_VARS['smile_pak'] : $HTTP_GET_VARS['smile_pak']; $clear_current = ( isset($HTTP_POST_VARS['clear_current']) ) ? $HTTP_POST_VARS['clear_current'] : $HTTP_GET_VARS['clear_current']; - $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? $HTTP_POST_VARS['replace'] : $HTTP_GET_VARS['replace']; + $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? intval($HTTP_POST_VARS['replace']) : intval($HTTP_GET_VARS['replace']); if ( !empty($smile_pak) ) { // // The user has already selected a smile_pak file.. Import it. // - if( !empty($clear_current) ) + if ( !empty($clear_current) ) { $sql = "DELETE FROM " . SMILIES_TABLE; @@ -141,13 +140,12 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // // Replace > and < with the proper html_entities for matching. // - $smile_data[$j] = str_replace("<", "<", $smile_data[$j]); - $smile_data[$j] = str_replace(">", ">", $smile_data[$j]); + $smile_data[$j] = htmlentities($smile_data[$j]); $k = $smile_data[$j]; - if( $smiles[$k] == 1 ) + if ( $smiles[$k] == 1 ) { - if( !empty($replace_existing) ) + if ( !empty($replace_existing) ) { $sql = "UPDATE " . SMILIES_TABLE . " SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' @@ -171,7 +169,7 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' } } - message_die(GENERAL_MESSAGE, $lang['smiley_import_success']); + message_die(MESSAGE, $lang['smiley_import_success']); } else @@ -180,7 +178,8 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // Display the script to get the smile_pak cfg file... // $smile_paks_select = "