• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revisionaf45651a61ea7d395efbb81f0489787fc12b1378 (tree)
Zeit2011-11-03 18:52:21
Autornbuy <nbuy@704c...>
Commiternbuy

Log Message

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

Ändern Zusammenfassung

Diff

--- a/html/include/comment_delete.php
+++ b/html/include/comment_delete.php
@@ -36,13 +36,13 @@ include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
3636 $op = 'delete';
3737 if (!empty($_POST)) {
3838 $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;
4141 $op = isset($_POST['op']) ? $_POST['op'] : 'delete';
4242 } else {
4343 $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;
4646
4747 }
4848
@@ -100,7 +100,7 @@ if (false != $accesserror) {
100100 if ($ref != '') {
101101 redirect_header($ref, 2, _NOPERM);
102102 } 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);
104104 }
105105 exit();
106106 }
--- a/html/include/comment_edit.php
+++ b/html/include/comment_edit.php
@@ -54,7 +54,7 @@ if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE ==
5454
5555 $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment');
5656
57-$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
57+$com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0;
5858 $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
5959 if ($com_mode == '') {
6060 if (is_object($xoopsUser)) {
@@ -70,7 +70,7 @@ if (!isset($_GET['com_order'])) {
7070 $com_order = $xoopsConfig['com_order'];
7171 }
7272 } else {
73- $com_order = intval($_GET['com_order']);
73+ $com_order = (int)$_GET['com_order'];
7474 }
7575 $comment_handler =& xoops_gethandler('comment');
7676 $comment =& $comment_handler->get($com_id);
--- a/html/include/comment_form.php
+++ b/html/include/comment_form.php
@@ -93,8 +93,8 @@ $br_checkbox->addOption(1, _CM_DOAUTOWRAP);
9393 $option_tray->addElement($br_checkbox);
9494
9595 $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));
9898 $cform->addElement(new XoopsFormHidden('com_id', $com_id));
9999 $cform->addElement(new XoopsFormHidden('com_itemid', $com_itemid));
100100 $cform->addElement(new XoopsFormHidden('com_order', $com_order));
--- a/html/include/comment_new.php
+++ b/html/include/comment_new.php
@@ -53,7 +53,7 @@ if ('system' != $xoopsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE ==
5353
5454 $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment'); ///< Is this must?
5555
56-$com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
56+$com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0;
5757
5858 if ($com_itemid > 0) {
5959 include XOOPS_ROOT_PATH.'/header.php';
@@ -85,7 +85,7 @@ if ($com_itemid > 0) {
8585 $com_order = $xoopsConfig['com_order'];
8686 }
8787 } else {
88- $com_order = intval($_GET['com_order']);
88+ $com_order = (int)$_GET['com_order'];
8989 }
9090 $noname = 0;
9191
--- a/html/include/comment_post.php
+++ b/html/include/comment_post.php
@@ -38,7 +38,7 @@ $t_root->mLanguageManager->loadPageTypeMessageCatalog("comment"); ///< @todo Is
3838
3939 include_once XOOPS_ROOT_PATH.'/include/comment_constants.php';
4040
41-$com_id = isset($_POST['com_id']) ? intval($_POST['com_id']) : 0;
41+$com_id = isset($_POST['com_id']) ? (int)$_POST['com_id'] : 0;
4242 $extra_params = '';
4343 if ('system' == $xoopsModule->getVar('dirname')) {
4444 if (empty($com_id)) {
@@ -90,18 +90,18 @@ if (!empty($_POST)) {
9090 // }
9191
9292 $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;
103103 $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;
105105 } else {
106106 exit();
107107 }
--- a/html/include/comment_reply.php
+++ b/html/include/comment_reply.php
@@ -50,7 +50,7 @@ $t_root->mLanguageManager->loadModuleMessageCatalog("legacy");
5050 $t_root->mLanguageManager->loadPageTypeMessageCatalog("comment"); ///< @todo Is this must?
5151
5252
53-$com_id = isset($_GET['com_id']) ? intval($_GET['com_id']) : 0;
53+$com_id = isset($_GET['com_id']) ? (int)$_GET['com_id'] : 0;
5454 $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
5555 if ($com_mode == '') {
5656 if (is_object($xoopsUser)) {
@@ -66,7 +66,7 @@ if (!isset($_GET['com_order'])) {
6666 $com_order = $xoopsConfig['com_order'];
6767 }
6868 } else {
69- $com_order = intval($_GET['com_order']);
69+ $com_order = (int)$_GET['com_order'];
7070 }
7171 $comment_handler =& xoops_gethandler('comment');
7272 $comment =& $comment_handler->get($com_id);
--- a/html/include/comment_view.php
+++ b/html/include/comment_view.php
@@ -47,7 +47,7 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
4747 $t_root =& XCube_Root::getSingleton();
4848 $t_root->mLanguageManager->loadPageTypeMessageCatalog('comment');
4949 $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;
5151
5252 if ($com_itemid > 0) {
5353 $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : '';
@@ -66,7 +66,7 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
6666 $com_order = $xoopsConfig['com_order'];
6767 }
6868 } else {
69- $com_order = intval($_GET['com_order']);
69+ $com_order = (int)$_GET['com_order'];
7070 }
7171 if ($com_order != XOOPS_COMMENT_OLD1ST) {
7272 $xoopsTpl->assign(array('comment_order' => XOOPS_COMMENT_NEW1ST, 'order_other' => XOOPS_COMMENT_OLD1ST));
@@ -82,8 +82,8 @@ if (XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule']) {
8282 $admin_view = false;
8383 }
8484
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;
8787 $comment_handler =& xoops_gethandler('comment');
8888 if ($com_mode == 'flat') {
8989 $comments =& $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid, $com_dborder);
--- a/html/include/commentform.inc.php
+++ b/html/include/commentform.inc.php
@@ -60,10 +60,10 @@ $smiley_checkbox->addOption(1, _DISABLESMILEY);
6060 $option_tray->addElement($smiley_checkbox);
6161
6262 $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));
6767 $button_tray = new XoopsFormElementTray('' ,'&nbsp;');
6868 $button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
6969 $button_tray->addElement(new XoopsFormButton('', 'post', _CM_POSTCOMMENT, 'submit'));
--- a/html/include/notification_functions.php
+++ b/html/include/notification_functions.php
@@ -373,7 +373,7 @@ function &notificationSubscribableCategoryInfo ($module_id=null)
373373 $sub_categories[] = $category;
374374 } else {
375375 $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;
377377 if ($id > 0) {
378378 $category['item_id'] = $id;
379379 $sub_categories[] = $category;
--- a/html/include/old_functions.php
+++ b/html/include/old_functions.php
@@ -36,7 +36,7 @@ function make_sidebar($side)
3636 }
3737 $xoopsLogger =& XoopsLogger::instance();
3838 for ($i = 0; $i < $block_count; $i++) {
39- $bcachetime = intval($block_arr[$i]->getVar('bcachetime'));
39+ $bcachetime = (int)$block_arr[$i]->getVar('bcachetime');
4040 if (empty($bcachetime)) {
4141 $xoopsTpl->xoops_setCaching(0);
4242 } else {
@@ -114,7 +114,7 @@ function make_cblock()
114114 $block_count = count($block_arr);
115115 $xoopsLogger =& XoopsLogger::instance();
116116 for ($i = 0; $i < $block_count; $i++) {
117- $bcachetime = intval($block_arr[$i]->getVar('bcachetime'));
117+ $bcachetime = (int)$block_arr[$i]->getVar('bcachetime');
118118 if (empty($bcachetime)) {
119119 $xoopsTpl->xoops_setCaching(0);
120120 } else {