XOOPS Cube Legacy base repository
Revision | af45651a61ea7d395efbb81f0489787fc12b1378 (tree) |
---|---|
Zeit | 2011-11-03 18:52:21 |
Autor | nbuy <nbuy@704c...> |
Commiter | nbuy |
replace intval() to cast (int) for speedup
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1031 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -36,13 +36,13 @@ include_once XOOPS_ROOT_PATH.'/include/comment_constants.php'; | ||
36 | 36 | $op = 'delete'; |
37 | 37 | if (!empty($_POST)) { |
38 | 38 | $com_mode = isset($_POST['com_mode']) ? htmlspecialchars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat'; |
39 | - $com_order = isset($_POST['com_order']) ? intval($_POST['com_order']) : XOOPS_COMMENT_OLD1ST; | |
40 | - $com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0; | |
39 | + $com_order = isset($_POST['com_order']) ? (int)$_POST['com_order'] : XOOPS_COMMENT_OLD1ST; | |
40 | + $com_id = isset($_POST['com_id']) ? (int)$_POST['com_id'] : 0; | |
41 | 41 | $op = isset($_POST['op']) ? $_POST['op'] : 'delete'; |
42 | 42 | } else { |
43 | 43 | $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : 'flat'; |
44 | - $com_order = isset($_GET['com_order']) ? intval($_GET['com_order']) : XOOPS_COMMENT_OLD1ST; | |
45 | - $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; | |
44 | + $com_order = isset($_GET['com_order']) ? (int)$_GET['com_order'] : XOOPS_COMMENT_OLD1ST; | |
45 | + $com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0; | |
46 | 46 | |
47 | 47 | } |
48 | 48 |
@@ -100,7 +100,7 @@ if (false != $accesserror) { | ||
100 | 100 | if ($ref != '') { |
101 | 101 | redirect_header($ref, 2, _NOPERM); |
102 | 102 | } else { |
103 | - redirect_header($redirect_page.'?'.$comment_config['itemName'].'='.intval($com_itemid), 2, _NOPERM); | |
103 | + redirect_header($redirect_page.'?'.$comment_config['itemName'].'='.(int)$com_itemid, 2, _NOPERM); | |
104 | 104 | } |
105 | 105 | exit(); |
106 | 106 | } |
@@ -54,7 +54,7 @@ if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == | ||
54 | 54 | |
55 | 55 | $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment'); |
56 | 56 | |
57 | -$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; | |
57 | +$com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0; | |
58 | 58 | $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; |
59 | 59 | if ($com_mode == '') { |
60 | 60 | if (is_object($xoopsUser)) { |
@@ -70,7 +70,7 @@ if (!isset($_GET['com_order'])) { | ||
70 | 70 | $com_order = $xoopsConfig['com_order']; |
71 | 71 | } |
72 | 72 | } else { |
73 | - $com_order = intval($_GET['com_order']); | |
73 | + $com_order = (int)$_GET['com_order']; | |
74 | 74 | } |
75 | 75 | $comment_handler =& xoops_gethandler('comment'); |
76 | 76 | $comment =& $comment_handler->get($com_id); |
@@ -93,8 +93,8 @@ $br_checkbox->addOption(1, _CM_DOAUTOWRAP); | ||
93 | 93 | $option_tray->addElement($br_checkbox); |
94 | 94 | |
95 | 95 | $cform->addElement($option_tray); |
96 | -$cform->addElement(new XoopsFormHidden('com_pid', intval($com_pid))); | |
97 | -$cform->addElement(new XoopsFormHidden('com_rootid', intval($com_rootid))); | |
96 | +$cform->addElement(new XoopsFormHidden('com_pid', (int)$com_pid)); | |
97 | +$cform->addElement(new XoopsFormHidden('com_rootid', (int)$com_rootid)); | |
98 | 98 | $cform->addElement(new XoopsFormHidden('com_id', $com_id)); |
99 | 99 | $cform->addElement(new XoopsFormHidden('com_itemid', $com_itemid)); |
100 | 100 | $cform->addElement(new XoopsFormHidden('com_order', $com_order)); |
@@ -53,7 +53,7 @@ if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == | ||
53 | 53 | |
54 | 54 | $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment'); ///< Is this must? |
55 | 55 | |
56 | -$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0; | |
56 | +$com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; | |
57 | 57 | |
58 | 58 | if ($com_itemid > 0) { |
59 | 59 | include XOOPS_ROOT_PATH.'/header.php'; |
@@ -85,7 +85,7 @@ if ($com_itemid > 0) { | ||
85 | 85 | $com_order = $xoopsConfig['com_order']; |
86 | 86 | } |
87 | 87 | } else { |
88 | - $com_order = intval($_GET['com_order']); | |
88 | + $com_order = (int)$_GET['com_order']; | |
89 | 89 | } |
90 | 90 | $noname = 0; |
91 | 91 |
@@ -38,7 +38,7 @@ $t_root->mLanguageManager->loadPageTypeMessageCatalog("comment"); ///< @todo Is | ||
38 | 38 | |
39 | 39 | include_once XOOPS_ROOT_PATH.'/include/comment_constants.php'; |
40 | 40 | |
41 | -$com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0; | |
41 | +$com_id = isset($_POST['com_id']) ? (int)$_POST['com_id'] : 0; | |
42 | 42 | $extra_params = ''; |
43 | 43 | if ('system' == $xoopsModule->getVar('dirname')) { |
44 | 44 | if (empty($com_id)) { |
@@ -90,18 +90,18 @@ if (!empty($_POST)) { | ||
90 | 90 | // } |
91 | 91 | |
92 | 92 | $com_mode = isset($_POST['com_mode']) ? htmlspecialchars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat'; |
93 | - $com_order = isset($_POST['com_order']) ? intval($_POST['com_order']) : XOOPS_COMMENT_OLD1ST; | |
94 | - $com_itemid = isset($_POST['com_itemid']) ? intval($_POST['com_itemid']) : 0; | |
95 | - $com_pid = isset($_POST['com_pid']) ? intval($_POST['com_pid']) : 0; | |
96 | - $com_rootid = isset($_POST['com_rootid']) ? intval($_POST['com_rootid']) : 0; | |
97 | - $com_status = isset($_POST['com_status']) ? intval($_POST['com_status']) : 0; | |
98 | - $dosmiley = (isset($_POST['dosmiley']) && intval($_POST['dosmiley']) > 0) ? 1 : 0; | |
99 | - $doxcode = (isset($_POST['doxcode']) && intval($_POST['doxcode']) > 0) ? 1 : 0; | |
100 | - $dobr = (isset($_POST['dobr']) && intval($_POST['dobr']) > 0) ? 1 : 0; | |
101 | - $dohtml = (isset($_POST['dohtml']) && intval($_POST['dohtml']) > 0) ? 1 : 0; | |
102 | - $doimage = (isset($_POST['doimage']) && intval($_POST['doimage']) > 0) ? 1 : 0; | |
93 | + $com_order = isset($_POST['com_order']) ? (int)$_POST['com_order'] : XOOPS_COMMENT_OLD1ST; | |
94 | + $com_itemid = isset($_POST['com_itemid']) ? (int)$_POST['com_itemid'] : 0; | |
95 | + $com_pid = isset($_POST['com_pid']) ? (int)$_POST['com_pid'] : 0; | |
96 | + $com_rootid = isset($_POST['com_rootid']) ? (int)$_POST['com_rootid'] : 0; | |
97 | + $com_status = isset($_POST['com_status']) ? (int)$_POST['com_status'] : 0; | |
98 | + $dosmiley = (isset($_POST['dosmiley']) && (int)$_POST['dosmiley'] > 0) ? 1 : 0; | |
99 | + $doxcode = (isset($_POST['doxcode']) && (int)$_POST['doxcode'] > 0) ? 1 : 0; | |
100 | + $dobr = (isset($_POST['dobr']) && (int)$_POST['dobr'] > 0) ? 1 : 0; | |
101 | + $dohtml = (isset($_POST['dohtml']) && (int)$_POST['dohtml'] > 0) ? 1 : 0; | |
102 | + $doimage = (isset($_POST['doimage']) && (int)$_POST['doimage'] > 0) ? 1 : 0; | |
103 | 103 | $com_icon = isset($_POST['com_icon']) ? trim($_POST['com_icon']) : ''; |
104 | - $noname = isset($_POST['noname']) ? intval($_POST['noname']) : 0; | |
104 | + $noname = isset($_POST['noname']) ? (int)$_POST['noname'] : 0; | |
105 | 105 | } else { |
106 | 106 | exit(); |
107 | 107 | } |
@@ -50,7 +50,7 @@ $t_root->mLanguageManager->loadModuleMessageCatalog("legacy"); | ||
50 | 50 | $t_root->mLanguageManager->loadPageTypeMessageCatalog("comment"); ///< @todo Is this must? |
51 | 51 | |
52 | 52 | |
53 | -$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; | |
53 | +$com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0; | |
54 | 54 | $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; |
55 | 55 | if ($com_mode == '') { |
56 | 56 | if (is_object($xoopsUser)) { |
@@ -66,7 +66,7 @@ if (!isset($_GET['com_order'])) { | ||
66 | 66 | $com_order = $xoopsConfig['com_order']; |
67 | 67 | } |
68 | 68 | } else { |
69 | - $com_order = intval($_GET['com_order']); | |
69 | + $com_order = (int)$_GET['com_order']; | |
70 | 70 | } |
71 | 71 | $comment_handler =& xoops_gethandler('comment'); |
72 | 72 | $comment =& $comment_handler->get($com_id); |
@@ -47,7 +47,7 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) { | ||
47 | 47 | $t_root =& XCube_Root::getSingleton(); |
48 | 48 | $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment'); |
49 | 49 | $comment_config = $xoopsModule->getInfo('comments'); |
50 | - $com_itemid = (trim($comment_config['itemName']) != '' && isset($_GET[$comment_config['itemName']])) ? intval($_GET[$comment_config['itemName']]) : 0; | |
50 | + $com_itemid = (trim($comment_config['itemName']) != '' && isset($_GET[$comment_config['itemName']])) ? (int)$_GET[$comment_config['itemName']] : 0; | |
51 | 51 | |
52 | 52 | if ($com_itemid > 0) { |
53 | 53 | $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; |
@@ -66,7 +66,7 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) { | ||
66 | 66 | $com_order = $xoopsConfig['com_order']; |
67 | 67 | } |
68 | 68 | } else { |
69 | - $com_order = intval($_GET['com_order']); | |
69 | + $com_order = (int)$_GET['com_order']; | |
70 | 70 | } |
71 | 71 | if ($com_order != XOOPS_COMMENT_OLD1ST) { |
72 | 72 | $xoopsTpl->assign(array('comment_order' => XOOPS_COMMENT_NEW1ST, 'order_other' => XOOPS_COMMENT_OLD1ST)); |
@@ -82,8 +82,8 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) { | ||
82 | 82 | $admin_view = false; |
83 | 83 | } |
84 | 84 | |
85 | - $com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0; | |
86 | - $com_rootid = isset($_GET['com_rootid']) ? intval($_GET['com_rootid']) : 0; | |
85 | + $com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0; | |
86 | + $com_rootid = isset($_GET['com_rootid']) ? (int)$_GET['com_rootid'] : 0; | |
87 | 87 | $comment_handler =& xoops_gethandler('comment'); |
88 | 88 | if ($com_mode == 'flat') { |
89 | 89 | $comments =& $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid, $com_dborder); |
@@ -60,10 +60,10 @@ $smiley_checkbox->addOption(1, _DISABLESMILEY); | ||
60 | 60 | $option_tray->addElement($smiley_checkbox); |
61 | 61 | |
62 | 62 | $cform->addElement($option_tray); |
63 | -$cform->addElement(new XoopsFormHidden('pid', intval($pid))); | |
64 | -$cform->addElement(new XoopsFormHidden('comment_id', intval($comment_id))); | |
65 | -$cform->addElement(new XoopsFormHidden('item_id', intval($item_id))); | |
66 | -$cform->addElement(new XoopsFormHidden('order', intval($order))); | |
63 | +$cform->addElement(new XoopsFormHidden('pid', (int)$pid)); | |
64 | +$cform->addElement(new XoopsFormHidden('comment_id', (int)$comment_id)); | |
65 | +$cform->addElement(new XoopsFormHidden('item_id', (int)$item_id)); | |
66 | +$cform->addElement(new XoopsFormHidden('order', (int)$order)); | |
67 | 67 | $button_tray = new XoopsFormElementTray('' ,' '); |
68 | 68 | $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit')); |
69 | 69 | $button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit')); |
@@ -373,7 +373,7 @@ function ¬ificationSubscribableCategoryInfo ($module_id=null) | ||
373 | 373 | $sub_categories[] = $category; |
374 | 374 | } else { |
375 | 375 | $item_name = $category['item_name']; |
376 | - $id = ($item_name != '' && isset($_GET[$item_name])) ? intval($_GET[$item_name]) : 0; | |
376 | + $id = ($item_name != '' && isset($_GET[$item_name])) ? (int)$_GET[$item_name] : 0; | |
377 | 377 | if ($id > 0) { |
378 | 378 | $category['item_id'] = $id; |
379 | 379 | $sub_categories[] = $category; |
@@ -36,7 +36,7 @@ function make_sidebar($side) | ||
36 | 36 | } |
37 | 37 | $xoopsLogger =& XoopsLogger::instance(); |
38 | 38 | for ($i = 0; $i < $block_count; $i++) { |
39 | - $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); | |
39 | + $bcachetime = (int)$block_arr[$i]->getVar('bcachetime'); | |
40 | 40 | if (empty($bcachetime)) { |
41 | 41 | $xoopsTpl->xoops_setCaching(0); |
42 | 42 | } else { |
@@ -114,7 +114,7 @@ function make_cblock() | ||
114 | 114 | $block_count = count($block_arr); |
115 | 115 | $xoopsLogger =& XoopsLogger::instance(); |
116 | 116 | for ($i = 0; $i < $block_count; $i++) { |
117 | - $bcachetime = intval($block_arr[$i]->getVar('bcachetime')); | |
117 | + $bcachetime = (int)$block_arr[$i]->getVar('bcachetime'); | |
118 | 118 | if (empty($bcachetime)) { |
119 | 119 | $xoopsTpl->xoops_setCaching(0); |
120 | 120 | } else { |