[TASK] Remove deprecated usages of intInRange, intval_positive and int_from_ver
authorSusanne Moog <typo3@susannemoog.de>
Sat, 9 Jul 2011 10:05:34 +0000 (12:05 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sat, 9 Jul 2011 19:45:39 +0000 (21:45 +0200)
This is part of the t3lib_div refactoring started at T3DD11.

With #28019 these methods have been moved to own utility
classes, now the Core should uses these.

Change-Id: Ib5b0d8f9a4322e5489b148e280993a3579fc21af
Resolves: #28026
Reviewed-on: http://review.typo3.org/3179
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
84 files changed:
t3lib/class.t3lib_clipboard.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_formmail.php
t3lib/class.t3lib_parsehtml.php
t3lib/class.t3lib_parsehtml_proc.php
t3lib/class.t3lib_positionmap.php
t3lib/class.t3lib_stdgraphic.php
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tceforms_inline.php
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_tsparser_ext.php
t3lib/class.t3lib_tstemplate.php
t3lib/class.t3lib_userauth.php
t3lib/class.t3lib_userauthgroup.php
t3lib/message/class.t3lib_message_abstractmessage.php
t3lib/search/class.t3lib_search_livesearch.php
t3lib/thumbs.php
t3lib/tree/pagetree/class.t3lib_tree_pagetree_commands.php
t3lib/utility/class.t3lib_utility_math.php
typo3/alt_clickmenu.php
typo3/alt_db_navframe.php
typo3/alt_doc.php
typo3/class.browse_links.php
typo3/class.db_list.inc
typo3/class.db_list_extra.inc
typo3/file_newfolder.php
typo3/file_upload.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_gifbuilder.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/sysext/cms/tslib/content/class.tslib_content_columns.php
typo3/sysext/cms/tslib/content/class.tslib_content_form.php
typo3/sysext/cms/tslib/content/class.tslib_content_horizontalruler.php
typo3/sysext/cms/tslib/content/class.tslib_content_imagetext.php
typo3/sysext/cms/tslib/content/class.tslib_content_searchresult.php
typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc
typo3/sysext/cms/tslib/media/scripts/gmenu_foldout.php
typo3/sysext/cms/tslib/media/scripts/gmenu_layers.php
typo3/sysext/cms/tslib/media/scripts/plaintextLib.inc
typo3/sysext/cms/tslib/media/scripts/postit.inc
typo3/sysext/cms/tslib/media/scripts/tmenu_layers.php
typo3/sysext/cms/tslib/media/scripts/wapversionLib.inc
typo3/sysext/cms/tslib/showpic.php
typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php
typo3/sysext/em/classes/extensions/class.tx_em_extensions_list.php
typo3/sysext/em/classes/tools/class.tx_em_tools.php
typo3/sysext/feedit/view/class.tx_feedit_editpanel.php
typo3/sysext/felogin/ext_tables.php
typo3/sysext/filelist/mod1/file_list.php
typo3/sysext/impexp/app/index.php
typo3/sysext/indexed_search/class.crawler.php
typo3/sysext/indexed_search/class.external_parser.php
typo3/sysext/indexed_search/class.indexer.php
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
typo3/sysext/install/Classes/Updates/Base.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/updates/class.tx_coreupdates_compatversion.php
typo3/sysext/install/updates/class.tx_coreupdates_cscsplit.php
typo3/sysext/install/updates/class.tx_coreupdates_migrateworkspaces.php
typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php
typo3/sysext/lowlevel/clmods/class.cleanflexform.php
typo3/sysext/lowlevel/clmods/class.deleted.php
typo3/sysext/lowlevel/clmods/class.versions.php
typo3/sysext/recordlist/mod1/index.php
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_status.php
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php
typo3/sysext/statictemplates/media/scripts/fe_adminLib.inc
typo3/sysext/statictemplates/media/scripts/gmenu_foldout.php
typo3/sysext/statictemplates/media/scripts/gmenu_layers.php
typo3/sysext/statictemplates/media/scripts/plaintextLib.inc
typo3/sysext/statictemplates/media/scripts/postit.inc
typo3/sysext/statictemplates/media/scripts/tmenu_layers.php
typo3/sysext/statictemplates/media/scripts/wapversionLib.inc
typo3/sysext/sys_action/task/class.tx_sysaction_task.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/tce_db.php
typo3/wizard_table.php

index eb286ac..27b07e4 100644 (file)
@@ -92,7 +92,7 @@ class t3lib_clipboard {
                        // NumberTabs
                $clNP = $GLOBALS['BE_USER']->getTSConfigVal('options.clipboardNumberPads');
                if (t3lib_div::testInt($clNP) && $clNP >= 0) {
-                       $this->numberTabs = t3lib_div::intInRange($clNP, 0, 20);
+                       $this->numberTabs = t3lib_utility_Math::forceIntegerInRange($clNP, 0, 20);
                }
 
                        // Resets/reinstates the clipboard pads
index ca62a44..84feeda 100644 (file)
@@ -811,7 +811,7 @@ final class t3lib_div {
        public static function compat_version($verNumberStr) {
                $currVersionStr = $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] : TYPO3_branch;
 
-               if (self::int_from_ver($currVersionStr) < self::int_from_ver($verNumberStr)) {
+               if (t3lib_utility_VersionNumber::convertVersionNumberToInteger($currVersionStr) < t3lib_utility_VersionNumber::convertVersionNumberToInteger($verNumberStr)) {
                        return FALSE;
                } else {
                        return TRUE;
@@ -962,9 +962,9 @@ final class t3lib_div {
         */
        public static function modifyHTMLColor($color, $R, $G, $B) {
                        // This takes a hex-color (# included!) and adds $R, $G and $B to the HTML-color (format: #xxxxxx) and returns the new color
-               $nR = self::intInRange(hexdec(substr($color, 1, 2)) + $R, 0, 255);
-               $nG = self::intInRange(hexdec(substr($color, 3, 2)) + $G, 0, 255);
-               $nB = self::intInRange(hexdec(substr($color, 5, 2)) + $B, 0, 255);
+               $nR = t3lib_utility_Math::forceIntegerInRange(hexdec(substr($color, 1, 2)) + $R, 0, 255);
+               $nG = t3lib_utility_Math::forceIntegerInRange(hexdec(substr($color, 3, 2)) + $G, 0, 255);
+               $nB = t3lib_utility_Math::forceIntegerInRange(hexdec(substr($color, 5, 2)) + $B, 0, 255);
                return '#' .
                                substr('0' . dechex($nR), -2) .
                                substr('0' . dechex($nG), -2) .
@@ -5384,7 +5384,7 @@ final class t3lib_div {
                        }
                }
 
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = self::intInRange($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'], 0, 4);
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'], 0, 4);
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogInit'] = TRUE;
        }
 
@@ -5400,7 +5400,7 @@ final class t3lib_div {
         * @return      void
         */
        public static function sysLog($msg, $extKey, $severity = 0) {
-               $severity = self::intInRange($severity, 0, 4);
+               $severity = t3lib_utility_Math::forceIntegerInRange($severity, 0, 4);
 
                        // is message worth logging?
                if (intval($GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel']) > $severity) {
index 45b55e9..eb65742 100644 (file)
@@ -130,7 +130,7 @@ class t3lib_formmail {
 
                        $this->replyToAddress = ($valueList['replyto_email']) ? $valueList['replyto_email'] : $this->fromAddress;
 
-                       $this->priority = ($valueList['priority']) ? t3lib_div::intInRange($valueList['priority'], 1, 5) : 3;
+                       $this->priority = ($valueList['priority']) ? t3lib_utility_Math::forceIntegerInRange($valueList['priority'], 1, 5) : 3;
 
                                // auto responder
                        $this->autoRespondMessage = (trim($valueList['auto_respond_msg']) && $this->fromAddress)
index 88b0d4e..dbce62a 100644 (file)
@@ -761,9 +761,9 @@ class t3lib_parsehtml {
                                                                                        }
                                                                                        if ($params['range']) {
                                                                                                if (isset($params['range'][1])) {
-                                                                                                       $tagAttrib[0][$attr] = t3lib_div::intInRange($tagAttrib[0][$attr], intval($params['range'][0]), intval($params['range'][1]));
+                                                                                                       $tagAttrib[0][$attr] = t3lib_utility_Math::forceIntegerInRange($tagAttrib[0][$attr], intval($params['range'][0]), intval($params['range'][1]));
                                                                                                } else {
-                                                                                                       $tagAttrib[0][$attr] = t3lib_div::intInRange($tagAttrib[0][$attr], intval($params['range'][0]));
+                                                                                                       $tagAttrib[0][$attr] = t3lib_utility_Math::forceIntegerInRange($tagAttrib[0][$attr], intval($params['range'][0]));
                                                                                                }
                                                                                        }
                                                                                        if (is_array($params['list'])) {
index d52e145..a9e8d43 100644 (file)
@@ -943,7 +943,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                        case 'typohead': // Transform typohead into Hx tags.
                                                if (!isset($this->procOptions['typohead']) || $this->procOptions['typohead']) {
                                                        $tC = $this->removeFirstAndLastTag($blockSplit[$k]);
-                                                       $typ = t3lib_div::intInRange($attribArray['type'], 0, 6);
+                                                       $typ = t3lib_utility_Math::forceIntegerInRange($attribArray['type'], 0, 6);
                                                        if (!$typ) {
                                                                $typ = 6;
                                                        }
index feb9aed..23a48ad 100644 (file)
@@ -399,7 +399,7 @@ class t3lib_positionMap {
 
                $row1 = '';
                $row2 = '';
-               $count = t3lib_div::intInRange(count($colPosArray), 1);
+               $count = t3lib_utility_Math::forceIntegerInRange(count($colPosArray), 1);
 
                $backendLayout = t3lib_div::callUserFunction('EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getSelectedBackendLayout', $pid, $this);
 
index 5fc2786..af7c0c4 100644 (file)
@@ -154,7 +154,7 @@ class t3lib_stdGraphic {
                }
 
                        // Setting default JPG parameters:
-               $this->jpegQuality = t3lib_div::intInRange($gfxConf['jpg_quality'], 10, 100, 75);
+               $this->jpegQuality = t3lib_utility_Math::forceIntegerInRange($gfxConf['jpg_quality'], 10, 100, 75);
                $this->cmds['jpg'] = $this->cmds['jpeg'] = '-colorspace RGB -sharpen 50 -quality ' . $this->jpegQuality;
 
                if ($gfxConf['im_combine_filename']) {
@@ -335,8 +335,8 @@ class t3lib_stdGraphic {
                $cpW = imagesx($cpImg);
                $cpH = imagesy($cpImg);
                $tile = t3lib_div::intExplode(',', $conf['tile']);
-               $tile[0] = t3lib_div::intInRange($tile[0], 1, 20);
-               $tile[1] = t3lib_div::intInRange($tile[1], 1, 20);
+               $tile[0] = t3lib_utility_Math::forceIntegerInRange($tile[0], 1, 20);
+               $tile[1] = t3lib_utility_Math::forceIntegerInRange($tile[1], 1, 20);
                $cpOff = $this->objPosition($conf, $workArea, array($cpW * $tile[0], $cpH * $tile[1]));
 
                for ($xt = 0; $xt < $tile[0]; $xt++) {
@@ -473,7 +473,7 @@ class t3lib_stdGraphic {
                                $fileColor = $tmpStr . '_colorNT.' . $this->gifExtension;
                                $fileMask = $tmpStr . '_maskNT.' . $this->gifExtension;
                                        // Scalefactor
-                               $sF = t3lib_div::intInRange($conf['niceText.']['scaleFactor'], 2, 5);
+                               $sF = t3lib_utility_Math::forceIntegerInRange($conf['niceText.']['scaleFactor'], 2, 5);
                                $newW = ceil($sF * imagesx($im));
                                $newH = ceil($sF * imagesy($im));
 
@@ -507,7 +507,7 @@ class t3lib_stdGraphic {
                                                if ($this->V5_EFFECTS) {
                                                        $command .= $this->v5_sharpen($conf['niceText.']['sharpen']);
                                                } else {
-                                                       $command .= ' -sharpen ' . t3lib_div::intInRange($conf['niceText.']['sharpen'], 1, 99);
+                                                       $command .= ' -sharpen ' . t3lib_utility_Math::forceIntegerInRange($conf['niceText.']['sharpen'], 1, 99);
                                                }
                                        }
                                }
@@ -1102,7 +1102,7 @@ class t3lib_stdGraphic {
                if (!$conf['niceText']) {
                        $sF = 1;
                } else { // NICETEXT::
-                       $sF = t3lib_div::intInRange($conf['niceText.']['scaleFactor'], 2, 5);
+                       $sF = t3lib_utility_Math::forceIntegerInRange($conf['niceText.']['scaleFactor'], 2, 5);
                }
                return $sF;
        }
@@ -1237,7 +1237,7 @@ class t3lib_stdGraphic {
                $thickness = intval($conf['thickness']);
                if ($thickness) {
                        $txtConf['fontColor'] = $conf['color'];
-                       $outLineDist = t3lib_div::intInRange($thickness, 1, 2);
+                       $outLineDist = t3lib_utility_Math::forceIntegerInRange($thickness, 1, 2);
                        for ($b = 1; $b <= $outLineDist; $b++) {
                                if ($b == 1) {
                                        $it = 8;
@@ -1314,7 +1314,7 @@ class t3lib_stdGraphic {
         */
        function makeShadow(&$im, $conf, $workArea, $txtConf) {
                $workArea = $this->applyOffset($workArea, t3lib_div::intExplode(',', $conf['offset']));
-               $blurRate = t3lib_div::intInRange(intval($conf['blur']), 0, 99);
+               $blurRate = t3lib_utility_Math::forceIntegerInRange(intval($conf['blur']), 0, 99);
 
                if (!$blurRate || $this->NO_IM_EFFECTS) { // No effects if ImageMagick ver. 5+
                        $txtConf['fontColor'] = $conf['color'];
@@ -1356,7 +1356,7 @@ class t3lib_stdGraphic {
                                        // Blurring of the mask
                                $times = ceil($blurRate / 10); // How many blur-commands that is executed. Min = 1;
                                $newBlurRate = $blurRate * 4; // Here I boost the blur-rate so that it is 100 already at 25. The rest is done by up to 99 iterations of the blur-command.
-                               $newBlurRate = t3lib_div::intInRange($newBlurRate, 1, 99);
+                               $newBlurRate = t3lib_utility_Math::forceIntegerInRange($newBlurRate, 1, 99);
                                for ($a = 0; $a < $times; $a++) { // Building blur-command
                                        $command .= ' -blur ' . $blurRate;
                                }
@@ -1375,12 +1375,12 @@ class t3lib_stdGraphic {
                                        // adjust the mask
                                $intensity = 40;
                                if ($conf['intensity']) {
-                                       $intensity = t3lib_div::intInRange($conf['intensity'], 0, 100);
+                                       $intensity = t3lib_utility_Math::forceIntegerInRange($conf['intensity'], 0, 100);
                                }
                                $intensity = ceil(255 - ($intensity / 100 * 255));
                                $this->inputLevels($blurTextImg, 0, $intensity, $this->maskNegate);
 
-                               $opacity = t3lib_div::intInRange(intval($conf['opacity']), 0, 100);
+                               $opacity = t3lib_utility_Math::forceIntegerInRange(intval($conf['opacity']), 0, 100);
                                if ($opacity && $opacity < 100) {
                                        $high = ceil(255 * $opacity / 100);
                                        $this->outputLevels($blurTextImg, 0, $high, $this->maskNegate); // reducing levels as the opacity demands
@@ -1436,7 +1436,7 @@ class t3lib_stdGraphic {
                                // conversion:
                                // PHP 0 = opaque, 127 = transparent
                                // TYPO3 100 = opaque, 0 = transparent
-                       $opacity = t3lib_div::intInRange(intval($conf['opacity']), 1, 100, 1);
+                       $opacity = t3lib_utility_Math::forceIntegerInRange(intval($conf['opacity']), 1, 100, 1);
                        $opacity = abs($opacity - 100);
                        $opacity = round((127 * $opacity) / 100);
                }
@@ -1521,7 +1521,7 @@ class t3lib_stdGraphic {
                                                if ($this->V5_EFFECTS) {
                                                        $commands .= $this->v5_blur($value);
                                                } else {
-                                                       $commands .= ' -blur ' . t3lib_div::intInRange($value, 1, 99);
+                                                       $commands .= ' -blur ' . t3lib_utility_Math::forceIntegerInRange($value, 1, 99);
                                                }
                                        }
                                break;
@@ -1530,31 +1530,31 @@ class t3lib_stdGraphic {
                                                if ($this->V5_EFFECTS) {
                                                        $commands .= $this->v5_sharpen($value);
                                                } else {
-                                                       $commands .= ' -sharpen ' . t3lib_div::intInRange($value, 1, 99);
+                                                       $commands .= ' -sharpen ' . t3lib_utility_Math::forceIntegerInRange($value, 1, 99);
                                                }
                                        }
                                break;
                                case 'rotate':
-                                       $commands .= ' -rotate ' . t3lib_div::intInRange($value, 0, 360);
+                                       $commands .= ' -rotate ' . t3lib_utility_Math::forceIntegerInRange($value, 0, 360);
                                break;
                                case 'solarize':
-                                       $commands .= ' -solarize ' . t3lib_div::intInRange($value, 0, 99);
+                                       $commands .= ' -solarize ' . t3lib_utility_Math::forceIntegerInRange($value, 0, 99);
                                break;
                                case 'swirl':
-                                       $commands .= ' -swirl ' . t3lib_div::intInRange($value, 0, 1000);
+                                       $commands .= ' -swirl ' . t3lib_utility_Math::forceIntegerInRange($value, 0, 1000);
                                break;
                                case 'wave':
                                        $params = t3lib_div::intExplode(',', $value);
-                                       $commands .= ' -wave ' . t3lib_div::intInRange($params[0], 0, 99) . 'x' . t3lib_div::intInRange($params[1], 0, 99);
+                                       $commands .= ' -wave ' . t3lib_utility_Math::forceIntegerInRange($params[0], 0, 99) . 'x' . t3lib_utility_Math::forceIntegerInRange($params[1], 0, 99);
                                break;
                                case 'charcoal':
-                                       $commands .= ' -charcoal ' . t3lib_div::intInRange($value, 0, 100);
+                                       $commands .= ' -charcoal ' . t3lib_utility_Math::forceIntegerInRange($value, 0, 100);
                                break;
                                case 'gray':
                                        $commands .= ' -colorspace GRAY';
                                break;
                                case 'edge':
-                                       $commands .= ' -edge ' . t3lib_div::intInRange($value, 0, 99);
+                                       $commands .= ' -edge ' . t3lib_utility_Math::forceIntegerInRange($value, 0, 99);
                                break;
                                case 'emboss':
                                        $commands .= ' -emboss';
@@ -1566,10 +1566,10 @@ class t3lib_stdGraphic {
                                        $commands .= ' -flop';
                                break;
                                case 'colors':
-                                       $commands .= ' -colors ' . t3lib_div::intInRange($value, 2, 255);
+                                       $commands .= ' -colors ' . t3lib_utility_Math::forceIntegerInRange($value, 2, 255);
                                break;
                                case 'shear':
-                                       $commands .= ' -shear ' . t3lib_div::intInRange($value, -90, 90);
+                                       $commands .= ' -shear ' . t3lib_utility_Math::forceIntegerInRange($value, -90, 90);
                                break;
                                case 'invert':
                                        $commands .= ' -negate';
@@ -1749,8 +1749,8 @@ class t3lib_stdGraphic {
         */
        function outputLevels(&$im, $low, $high, $swap = '') {
                if ($low < $high) {
-                       $low = t3lib_div::intInRange($low, 0, 255);
-                       $high = t3lib_div::intInRange($high, 0, 255);
+                       $low = t3lib_utility_Math::forceIntegerInRange($low, 0, 255);
+                       $high = t3lib_utility_Math::forceIntegerInRange($high, 0, 255);
 
                        if ($swap) {
                                $temp = $low;
@@ -1781,8 +1781,8 @@ class t3lib_stdGraphic {
         */
        function inputLevels(&$im, $low, $high, $swap = '') {
                if ($low < $high) {
-                       $low = t3lib_div::intInRange($low, 0, 255);
-                       $high = t3lib_div::intInRange($high, 0, 255);
+                       $low = t3lib_utility_Math::forceIntegerInRange($low, 0, 255);
+                       $high = t3lib_utility_Math::forceIntegerInRange($high, 0, 255);
 
                        if ($swap) {
                                $temp = $low;
@@ -1794,9 +1794,9 @@ class t3lib_stdGraphic {
                        $totalCols = ImageColorsTotal($im);
                        for ($c = 0; $c < $totalCols; $c++) {
                                $cols = ImageColorsForIndex($im, $c);
-                               $cols['red'] = t3lib_div::intInRange(($cols['red'] - $low) / $delta * 255, 0, 255);
-                               $cols['green'] = t3lib_div::intInRange(($cols['green'] - $low) / $delta * 255, 0, 255);
-                               $cols['blue'] = t3lib_div::intInRange(($cols['blue'] - $low) / $delta * 255, 0, 255);
+                               $cols['red'] = t3lib_utility_Math::forceIntegerInRange(($cols['red'] - $low) / $delta * 255, 0, 255);
+                               $cols['green'] = t3lib_utility_Math::forceIntegerInRange(($cols['green'] - $low) / $delta * 255, 0, 255);
+                               $cols['blue'] = t3lib_utility_Math::forceIntegerInRange(($cols['blue'] - $low) / $delta * 255, 0, 255);
                                ImageColorSet($im, $c, $cols['red'], $cols['green'], $cols['blue']);
                        }
                }
@@ -1813,7 +1813,7 @@ class t3lib_stdGraphic {
                $fI = t3lib_div::split_fileref($file);
                $ext = strtolower($fI['fileext']);
                $result = $this->randomName() . '.' . $ext;
-               if (($reduce = t3lib_div::intInRange($cols, 0, ($ext == 'gif' ? 256 : $this->truecolorColors), 0)) > 0) {
+               if (($reduce = t3lib_utility_Math::forceIntegerInRange($cols, 0, ($ext == 'gif' ? 256 : $this->truecolorColors), 0)) > 0) {
                        $params = ' -colors ' . $reduce;
                        if ($reduce <= 256) {
                                $params .= ' -type Palette';
@@ -1859,7 +1859,7 @@ class t3lib_stdGraphic {
         * @see makeText(), IMparams(), v5_blur()
         */
        function v5_sharpen($factor) {
-               $factor = t3lib_div::intInRange(ceil($factor / 10), 0, 10);
+               $factor = t3lib_utility_Math::forceIntegerInRange(ceil($factor / 10), 0, 10);
 
                $sharpenArr = explode(',', ',' . $this->im5fx_sharpenSteps);
                $sharpenF = trim($sharpenArr[$factor]);
@@ -1878,7 +1878,7 @@ class t3lib_stdGraphic {
         * @see makeText(), IMparams(), v5_sharpen()
         */
        function v5_blur($factor) {
-               $factor = t3lib_div::intInRange(ceil($factor / 10), 0, 10);
+               $factor = t3lib_utility_Math::forceIntegerInRange(ceil($factor / 10), 0, 10);
 
                $blurArr = explode(',', ',' . $this->im5fx_blurSteps);
                $blurF = trim($blurArr[$factor]);
@@ -1950,14 +1950,14 @@ class t3lib_stdGraphic {
                        $cParts[1] = trim($cParts[1]);
                        if (substr($cParts[1], 0, 1) == '*') {
                                $val = doubleval(substr($cParts[1], 1));
-                               $col[0] = t3lib_div::intInRange($col[0] * $val, 0, 255);
-                               $col[1] = t3lib_div::intInRange($col[1] * $val, 0, 255);
-                               $col[2] = t3lib_div::intInRange($col[2] * $val, 0, 255);
+                               $col[0] = t3lib_utility_Math::forceIntegerInRange($col[0] * $val, 0, 255);
+                               $col[1] = t3lib_utility_Math::forceIntegerInRange($col[1] * $val, 0, 255);
+                               $col[2] = t3lib_utility_Math::forceIntegerInRange($col[2] * $val, 0, 255);
                        } else {
                                $val = intval($cParts[1]);
-                               $col[0] = t3lib_div::intInRange($col[0] + $val, 0, 255);
-                               $col[1] = t3lib_div::intInRange($col[1] + $val, 0, 255);
-                               $col[2] = t3lib_div::intInRange($col[2] + $val, 0, 255);
+                               $col[0] = t3lib_utility_Math::forceIntegerInRange($col[0] + $val, 0, 255);
+                               $col[1] = t3lib_utility_Math::forceIntegerInRange($col[1] + $val, 0, 255);
+                               $col[2] = t3lib_utility_Math::forceIntegerInRange($col[2] + $val, 0, 255);
                        }
                }
                return $col;
@@ -2679,7 +2679,7 @@ class t3lib_stdGraphic {
                                        if ($this->ImageWrite($this->im, $file)) {
                                                        // ImageMagick operations
                                                if ($this->setup['reduceColors'] || !$this->png_truecolor) {
-                                                       $reduced = $this->IMreduceColors($file, t3lib_div::intInRange($this->setup['reduceColors'], 256, $this->truecolorColors, 256));
+                                                       $reduced = $this->IMreduceColors($file, t3lib_utility_Math::forceIntegerInRange($this->setup['reduceColors'], 256, $this->truecolorColors, 256));
                                                        if ($reduced) {
                                                                @copy($reduced, $file);
                                                                @unlink($reduced);
@@ -2692,7 +2692,7 @@ class t3lib_stdGraphic {
                                case 'jpeg':
                                        $quality = 0; // Use the default
                                        if ($this->setup['quality']) {
-                                               $quality = t3lib_div::intInRange($this->setup['quality'], 10, 100);
+                                               $quality = t3lib_utility_Math::forceIntegerInRange($this->setup['quality'], 10, 100);
                                        }
                                        if ($this->ImageWrite($this->im, $file, $quality)) {
                                                ;
index 3e4c751..beeaeff 100644 (file)
@@ -907,7 +907,7 @@ class t3lib_TCEforms {
                $config = $PA['fieldConf']['config'];
 
                $specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
-               $size = t3lib_div::intInRange($config['size'] ? $config['size'] : 30, 5, $this->maxInputWidth);
+               $size = t3lib_utility_Math::forceIntegerInRange($config['size'] ? $config['size'] : 30, 5, $this->maxInputWidth);
                $evalList = t3lib_div::trimExplode(',', $config['eval'], 1);
                $classAndStyleAttributes = $this->formWidthAsArray($size);
 
@@ -1090,13 +1090,13 @@ class t3lib_TCEforms {
                }
 
                        // Setting columns number:
-               $cols = t3lib_div::intInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
+               $cols = t3lib_utility_Math::forceIntegerInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
 
                        // Setting number of rows:
-               $origRows = $rows = t3lib_div::intInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
+               $origRows = $rows = t3lib_utility_Math::forceIntegerInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
                if (strlen($PA['itemFormElValue']) > $this->charsPerRow * 2) {
                        $cols = $this->maxTextareaWidth;
-                       $rows = t3lib_div::intInRange(round(strlen($PA['itemFormElValue']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue'])), 20);
+                       $rows = t3lib_utility_Math::forceIntegerInRange(round(strlen($PA['itemFormElValue']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue'])), 20);
                        if ($rows < $origRows) {
                                $rows = $origRows;
                        }
@@ -1851,7 +1851,7 @@ class t3lib_TCEforms {
                $selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"';
                $size = intval($config['size']);
                $cssPrefix = ($size === 1) ? 'tceforms-select' : 'tceforms-multiselect';
-               $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($selItems) + 1, t3lib_div::intInRange($size, 1), $config['autoSizeMax']) : $size;
+               $size = $config['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange(count($selItems) + 1, t3lib_utility_Math::forceIntegerInRange($size, 1), $config['autoSizeMax']) : $size;
                $selectBox = '<select id="' . uniqid($cssPrefix) . '" name="' . $PA['itemFormElName'] . '[]"' .
                                         $this->insertDefStyle('select', $cssPrefix) .
                                         ($size ? ' size="' . $size . '"' : '') .
@@ -1920,11 +1920,11 @@ class t3lib_TCEforms {
                }
 
                        // Set max and min items:
-               $maxitems = t3lib_div::intInRange($config['maxitems'], 0);
+               $maxitems = t3lib_utility_Math::forceIntegerInRange($config['maxitems'], 0);
                if (!$maxitems) {
                        $maxitems = 100000;
                }
-               $minitems = t3lib_div::intInRange($config['minitems'], 0);
+               $minitems = t3lib_utility_Math::forceIntegerInRange($config['minitems'], 0);
 
                        // Register the required number of elements:
                $this->registerRequiredProperty('range', $PA['itemFormElName'], array($minitems, $maxitems, 'imgName' => $table . '_' . $row['uid'] . '_' . $field));
@@ -1978,7 +1978,7 @@ class t3lib_TCEforms {
                                // Put together the selector box:
                        $selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"';
                        $size = intval($config['size']);
-                       $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($itemArray) + 1, t3lib_div::intInRange($size, 1), $config['autoSizeMax']) : $size;
+                       $size = $config['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange(count($itemArray) + 1, t3lib_utility_Math::forceIntegerInRange($size, 1), $config['autoSizeMax']) : $size;
                        if ($config['exclusiveKeys']) {
                                $sOnChange = 'setFormValueFromBrowseWin(\'' . $PA['itemFormElName'] . '\',this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,\'' . $config['exclusiveKeys'] . '\'); ';
                        } else {
@@ -2000,7 +2000,7 @@ class t3lib_TCEforms {
                        // Pass to "dbFileIcons" function:
                $params = array(
                        'size' => $size,
-                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+                       'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
                        'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
                        'dontShowMoveIcons' => ($maxitems <= 1),
                        'maxitems' => $maxitems,
@@ -2034,11 +2034,11 @@ class t3lib_TCEforms {
                $internal_type = $config['internal_type'];
                $show_thumbs = $config['show_thumbs'];
                $size = intval($config['size']);
-               $maxitems = t3lib_div::intInRange($config['maxitems'], 0);
+               $maxitems = t3lib_utility_Math::forceIntegerInRange($config['maxitems'], 0);
                if (!$maxitems) {
                        $maxitems = 100000;
                }
-               $minitems = t3lib_div::intInRange($config['minitems'], 0);
+               $minitems = t3lib_utility_Math::forceIntegerInRange($config['minitems'], 0);
                $allowed = trim($config['allowed']);
                $disallowed = trim($config['disallowed']);
 
@@ -2124,7 +2124,7 @@ class t3lib_TCEforms {
                                $params = array(
                                        'size' => $size,
                                        'dontShowMoveIcons' => ($maxitems <= 1),
-                                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+                                       'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
                                        'info' => $info,
@@ -2151,7 +2151,7 @@ class t3lib_TCEforms {
                                $params = array(
                                        'size' => $size,
                                        'dontShowMoveIcons' => ($maxitems <= 1),
-                                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+                                       'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle']) ?
                                                        ' style="' . htmlspecialchars($config['selectedListStyle']) . '"'
@@ -2234,7 +2234,7 @@ class t3lib_TCEforms {
                                $params = array(
                                        'size' => $size,
                                        'dontShowMoveIcons' => ($maxitems <= 1),
-                                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+                                       'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
                                        'maxitems' => $maxitems,
                                        'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
                                        'info' => $info,
@@ -2298,12 +2298,12 @@ class t3lib_TCEforms {
                                $itemValue = nl2br(htmlspecialchars($itemValue));
                        }
                                // like textarea
-                       $cols = t3lib_div::intInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
+                       $cols = t3lib_utility_Math::forceIntegerInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
                        if (!$config['fixedRows']) {
-                               $origRows = $rows = t3lib_div::intInRange($rows, 1, 20);
+                               $origRows = $rows = t3lib_utility_Math::forceIntegerInRange($rows, 1, 20);
                                if (strlen($itemValue) > $this->charsPerRow * 2) {
                                        $cols = $this->maxTextareaWidth;
-                                       $rows = t3lib_div::intInRange(round(strlen($itemValue) / $this->charsPerRow), count(explode(LF, $itemValue)), 20);
+                                       $rows = t3lib_utility_Math::forceIntegerInRange(round(strlen($itemValue) / $this->charsPerRow), count(explode(LF, $itemValue)), 20);
                                        if ($rows < $origRows) {
                                                $rows = $origRows;
                                        }
@@ -2967,7 +2967,7 @@ class t3lib_TCEforms {
                                $itemValue = sprintf('%' . $format, $itemValue);
                        break;
                        case 'float':
-                               $precision = t3lib_div::intInRange($config['format.']['precision'], 1, 10, 2);
+                               $precision = t3lib_utility_Math::forceIntegerInRange($config['format.']['precision'], 1, 10, 2);
                                $itemValue = sprintf('%.' . $precision . 'f', $itemValue);
                        break;
                        case 'number':
@@ -3087,12 +3087,12 @@ class t3lib_TCEforms {
                        // If a bitmask-value field has been configured, then find possible fields to exclude based on that:
                if ($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_value_field']) {
                        $sTfield = $GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_value_field'];
-                       $sTValue = t3lib_div::intInRange($row[$sTfield], 0);
+                       $sTValue = t3lib_utility_Math::forceIntegerInRange($row[$sTfield], 0);
                        if (is_array($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'])) {
                                foreach ($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'] as $bitKey => $eList) {
                                        $bit = substr($bitKey, 1);
                                        if (t3lib_div::testInt($bit)) {
-                                               $bit = t3lib_div::intInRange($bit, 0, 30);
+                                               $bit = t3lib_utility_Math::forceIntegerInRange($bit, 0, 30);
                                                if (
                                                        (substr($bitKey, 0, 1) == '-' && !($sTValue & pow(2, $bit))) ||
                                                        (substr($bitKey, 0, 1) == '+' && ($sTValue & pow(2, $bit)))
@@ -3554,7 +3554,7 @@ class t3lib_TCEforms {
                }
 
                        // Create selector box of the options
-               $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC + 1, t3lib_div::intInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
+               $sSize = $params['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange($itemArrayC + 1, t3lib_utility_Math::forceIntegerInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
                if (!$selector) {
                        $selector = '<select id="' . uniqid('tceforms-multiselect-') . '" ' . ($params['noList'] ? 'style="display: none"' : 'size="' . $sSize . '"' . $this->insertDefStyle('group', 'tceforms-multiselect')) . ' multiple="multiple" name="' . $fName . '_list" ' . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . '</select>';
                }
@@ -3950,8 +3950,8 @@ class t3lib_TCEforms {
                                                // Color wizard colorbox:
                                        if ((string) $wConf['type'] == 'colorbox') {
                                                $dim = t3lib_div::intExplode('x', $wConf['dim']);
-                                               $dX = t3lib_div::intInRange($dim[0], 1, 200, 20);
-                                               $dY = t3lib_div::intInRange($dim[1], 1, 200, 20);
+                                               $dX = t3lib_utility_Math::forceIntegerInRange($dim[0], 1, 200, 20);
+                                               $dY = t3lib_utility_Math::forceIntegerInRange($dim[1], 1, 200, 20);
                                                $color = $PA['itemFormElValue'] ? ' bgcolor="' . htmlspecialchars($PA['itemFormElValue']) . '"' : '';
                                                $outArr[] = '<table border="0" cellpadding="0" cellspacing="0" id="' . $md5ID . '"' . $color . ' style="' . htmlspecialchars($wConf['tableStyle']) . '">
                                                                        <tr>
@@ -4066,8 +4066,8 @@ class t3lib_TCEforms {
                                $padLeft = 22; // In order to get the same padding for all option tags even if icon sizes differ a little, set it to 22 if it was between 18 and 24 pixels
                        }
 
-                       $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0);
-                       $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_div::intInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
+                       $padTop = t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
+                       $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
                        return $styleAttr;
                }
        }
@@ -4089,7 +4089,7 @@ class t3lib_TCEforms {
                                        // set it to 22, if it was between 18 and 24 pixels.
                                $padLeft = 22;
                        }
-                       $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0);
+                       $padTop = t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
 
                        return 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
                }
@@ -4468,7 +4468,7 @@ class t3lib_TCEforms {
 
                                        // Configurations:
                                $extList = $fieldValue['config']['fileFolder_extList'];
-                               $recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_div::intInRange($fieldValue['config']['fileFolder_recursions'], 0, 99) : 99;
+                               $recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_utility_Math::forceIntegerInRange($fieldValue['config']['fileFolder_recursions'], 0, 99) : 99;
 
                                        // Get files:
                                $fileFolder = rtrim($fileFolder, '/') . '/';
index 946daa8..de1dbbc 100644 (file)
@@ -131,8 +131,8 @@ class t3lib_TCEforms_inline {
                if (t3lib_BEfunc::isTableLocalizable($table)) {
                        $language = intval($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]);
                }
-               $minitems = t3lib_div::intInRange($config['minitems'], 0);
-               $maxitems = t3lib_div::intInRange($config['maxitems'], 0);
+               $minitems = t3lib_utility_Math::forceIntegerInRange($config['minitems'], 0);
+               $maxitems = t3lib_utility_Math::forceIntegerInRange($config['maxitems'], 0);
                if (!$maxitems) {
                        $maxitems = 100000;
                }
@@ -797,7 +797,7 @@ class t3lib_TCEforms_inline {
                                // Put together the selector box:
                        $selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->fObj->defaultMultipleSelectorStyle . '"';
                        $size = intval($conf['size']);
-                       $size = $conf['autoSizeMax'] ? t3lib_div::intInRange(count($selItems) + 1, t3lib_div::intInRange($size, 1), $conf['autoSizeMax']) : $size;
+                       $size = $conf['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange(count($selItems) + 1, t3lib_utility_Math::forceIntegerInRange($size, 1), $conf['autoSizeMax']) : $size;
                        $onChange = "return inline.importNewRecord('" . $this->inlineNames['object'] . self::Structure_Separator . $conf['foreign_table'] . "')";
                        $item = '
                                <select id="' . $this->inlineNames['object'] . self::Structure_Separator . $conf['foreign_table'] . '_selector"' .
index 5cf1728..191e097 100644 (file)
@@ -712,7 +712,7 @@ class t3lib_TCEmain {
                                                                        if ($createNewVersion) { // This creates a new version of the record with online placeholder and offline version
                                                                                $versioningType = ($table === 'pages'
                                                                                        ? $this->BE_USER->workspaceVersioningTypeGetClosest(
-                                                                                               t3lib_div::intInRange($GLOBALS['TYPO3_CONF_VARS']['BE']['newPagesVersioningType'], -1, 1))
+                                                                                               t3lib_utility_Math::forceIntegerInRange($GLOBALS['TYPO3_CONF_VARS']['BE']['newPagesVersioningType'], -1, 1))
                                                                                        : -1);
                                                                                if ($this->BE_USER->workspaceVersioningTypeAccess($versioningType)) {
                                                                                        $newVersion_placeholderFieldArray['t3ver_label'] = 'INITIAL PLACEHOLDER';
@@ -5653,7 +5653,7 @@ class t3lib_TCEmain {
                        $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
 
                        $tE = $this->getTableEntries($table, $TSConfig);
-                       $maxAgeSeconds = 60 * 60 * 24 * (strcmp($tE['history.']['maxAgeDays'], '') ? t3lib_div::intInRange($tE['history.']['maxAgeDays'], 0, 365) : 30); // one month
+                       $maxAgeSeconds = 60 * 60 * 24 * (strcmp($tE['history.']['maxAgeDays'], '') ? t3lib_utility_Math::forceIntegerInRange($tE['history.']['maxAgeDays'], 0, 365) : 30); // one month
 
                                // Garbage collect old entries:
                        $this->clearHistory($maxAgeSeconds, $table);
index 4ea5461..78e202c 100644 (file)
@@ -1578,7 +1578,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                                switch ($typeDat['type']) {
                                                        case 'int':
                                                                if ($typeDat['paramstr']) {
-                                                                       $var = t3lib_div::intInRange($var, $typeDat['params'][0], $typeDat['params'][1]);
+                                                                       $var = t3lib_utility_Math::forceIntegerInRange($var, $typeDat['params'][0], $typeDat['params'][1]);
                                                                } else {
                                                                        $var = intval($var);
                                                                }
index 2d76f0e..38a9c44 100644 (file)
@@ -770,7 +770,7 @@ class t3lib_TStemplate {
                        $findConst = explode('{$', $all);
                        array_shift($findConst);
                        foreach ($findConst as $constVal) {
-                               $constLen = t3lib_div::intInRange(strcspn($constVal, '}'), 0, 50);
+                               $constLen = t3lib_utility_Math::forceIntegerInRange(strcspn($constVal, '}'), 0, 50);
                                $theConstList[] = '{$' . substr($constVal, 0, $constLen + 1);
                        }
                        if ($this->tt_track) {
index 305f47f..81eb2d2 100644 (file)
@@ -969,7 +969,7 @@ abstract class t3lib_userAuth {
                if ($parts >= 4) {
                        return $IP;
                } else {
-                       $parts = t3lib_div::intInRange($parts, 1, 3);
+                       $parts = t3lib_utility_Math::forceIntegerInRange($parts, 1, 3);
                        $IPparts = explode('.', $IP);
                        for ($a = 4; $a > $parts; $a--) {
                                unset($IPparts[$a - 1]);
index bf6fb92..263c2f9 100644 (file)
@@ -909,7 +909,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
        function workspaceVersioningTypeAccess($type) {
                $retVal = FALSE;
 
-               $type = t3lib_div::intInRange($type, -1);
+               $type = t3lib_utility_Math::forceIntegerInRange($type, -1);
 
                        // Check if only element versioning is allowed:
                if ($GLOBALS['TYPO3_CONF_VARS']['BE']['elementVersioningOnly'] && $type != -1) {
@@ -949,7 +949,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         * @return      integer         Returning versioning type
         */
        function workspaceVersioningTypeGetClosest($type) {
-               $type = t3lib_div::intInRange($type, -1);
+               $type = t3lib_utility_Math::forceIntegerInRange($type, -1);
 
                if ($this->workspace > 0) {
                        switch ((int) $type) {
index b800480..43306aa 100644 (file)
@@ -122,7 +122,7 @@ abstract class t3lib_message_AbstractMessage {
         * @return      void
         */
        public function setSeverity($severity = self::OK) {
-               $this->severity = t3lib_div::intInRange(
+               $this->severity = t3lib_utility_Math::forceIntegerInRange(
                        $severity,
                        self::NOTICE, // minimum
                        self::ERROR, // maximum
index 91127b2..a703b94 100644 (file)
@@ -440,7 +440,7 @@ class t3lib_search_livesearch {
         * @return void
         */
        public function setLimitCount($limitCount) {
-               $limit = t3lib_div::intval_positive($limitCount);
+               $limit = t3lib_utility_Math::convertToPositiveInteger($limitCount);
                if ($limit > 0) {
                        $this->limitCount = $limit;
                }
@@ -453,7 +453,7 @@ class t3lib_search_livesearch {
         * @return void
         */
        public function setStartCount($startCount) {
-               $this->startCount = t3lib_div::intval_positive($startCount);
+               $this->startCount = t3lib_utility_Math::convertToPositiveInteger($startCount);
        }
 
        /**
index c3a8c1e..3539c3c 100644 (file)
@@ -197,7 +197,7 @@ class SC_t3lib_thumbs {
 
                                // I added extra check, so that the size input option could not be fooled to pass other values. That means the value is exploded, evaluated to an integer and the imploded to [value]x[value]. Furthermore you can specify: size=340 and it'll be translated to 340x340.
                        $sizeParts = explode('x', $this->size . 'x' . $this->size);     // explodes the input size (and if no "x" is found this will add size again so it is the same for both dimensions)
-                       $sizeParts = array(t3lib_div::intInRange($sizeParts[0], 1, 1000), t3lib_div::intInRange($sizeParts[1], 1, 1000));       // Cleaning it up, only two parameters now.
+                       $sizeParts = array(t3lib_utility_Math::forceIntegerInRange($sizeParts[0], 1, 1000), t3lib_utility_Math::forceIntegerInRange($sizeParts[1], 1, 1000));   // Cleaning it up, only two parameters now.
                        $this->size = implode('x', $sizeParts);         // Imploding the cleaned size-value back to the internal variable
                        $sizeMax = max($sizeParts);     // Getting max value
 
@@ -206,7 +206,7 @@ class SC_t3lib_thumbs {
 
                                // Should be - ? 'png' : 'gif' - , but doesn't work (ImageMagick prob.?)
                                // RenĂ©: png work for me
-                       $thmMode = t3lib_div::intInRange($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails_png'], 0);
+                       $thmMode = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails_png'], 0);
                        $outext = ($ext!='jpg' || ($thmMode & 2)) ? ($thmMode & 1 ? 'png' : 'gif') : 'jpg';
 
                        $outfile = 'tmb_' . substr(md5($this->input . $this->mtime . $this->size), 0, 10) . '.' . $outext;
index b400767..cfe8b54 100644 (file)
@@ -170,7 +170,7 @@ final class t3lib_tree_pagetree_Commands {
                $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                $tce->stripslashes_values = 0;
                $tce->start($data, $cmd);
-               $tce->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
+               $tce->copyTree = t3lib_utility_Math::forceIntegerInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
 
                if (count($cmd)) {
                        $tce->process_cmdmap();
index e04657f..619a6f6 100644 (file)
@@ -48,7 +48,7 @@ final class t3lib_utility_Math {
                $theInt = intval($theInt);
                if ($defaultValue && !$theInt) {
                        $theInt = $defaultValue;
-               } // If the input value is zero after being converted to integer, zeroValue may set another default value for it.
+               } // If the input value is zero after being converted to integer, defaultValue may set another default value for it.
                if ($theInt < $min) {
                        $theInt = $min;
                }
index a9663a8..5d3e4a4 100644 (file)
@@ -1590,7 +1590,7 @@ class SC_alt_clickmenu {
                }
 
                        // Setting clickmenu timeout
-               $secs = t3lib_div::intInRange($GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'), 1, 100, 5);  // default is 5
+               $secs = t3lib_utility_Math::forceIntegerInRange($GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'), 1, 100, 5);        // default is 5
 
                        // Setting the JavaScript controlling the timer on the page
                $listFrameDoc = $this->reloadListFrame!=2 ? 'top.content.list_frame' : 'top.content';
index b9664ed..ca682c0 100644 (file)
@@ -330,7 +330,7 @@ class SC_alt_db_navframe {
 
                        // Set/Cancel Temporary DB Mount:
                if (strlen($this->setTempDBmount))      {
-                       $set = t3lib_div::intInRange($this->setTempDBmount,0);
+                       $set = t3lib_utility_Math::forceIntegerInRange($this->setTempDBmount,0);
                        if ($set > 0 && $GLOBALS['BE_USER']->isInWebMount($set)){
                                        // Setting...:
                                $this->settingTemporaryMountPoint($set);
index cd6140d..23f184e 100644 (file)
@@ -452,7 +452,7 @@ class SC_alt_doc {
 
                        // Setting up the context sensitive menu:
                $this->doc->getContextMenuCode();
-               $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,'.t3lib_div::intInRange(t3lib_div::_GP('_scrollPosition'),0,10000).');"';
+               $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,'.t3lib_utility_Math::forceIntegerInRange(t3lib_div::_GP('_scrollPosition'),0,10000).');"';
        }
 
        /**
index 079201a..ab39b20 100644 (file)
@@ -1874,7 +1874,7 @@ class browse_links {
 
                                // Initialize the record listing:
                        $id = $this->expandPage;
-                       $pointer = t3lib_div::intInRange($this->pointer,0,100000);
+                       $pointer = t3lib_utility_Math::forceIntegerInRange($this->pointer,0,100000);
                        $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                        $pageinfo = t3lib_BEfunc::readPageAccess($id,$perms_clause);
                        $table='';
index d1f3c4b..e6bb58e 100644 (file)
@@ -127,7 +127,7 @@ class recordList extends t3lib_recordList {
                $this->firstElementNumber=$pointer;
                $this->searchString=trim($search);
                $this->searchLevels=trim($levels);
-               $this->showLimit=t3lib_div::intInRange($showLimit,0,10000);
+               $this->showLimit=t3lib_utility_Math::forceIntegerInRange($showLimit,0,10000);
 
                        // Setting GPvars:
                $this->csvOutput = t3lib_div::_GP('csv') ? TRUE : FALSE;
@@ -152,10 +152,10 @@ class recordList extends t3lib_recordList {
 
                        // limits
                if(isset($this->modTSconfig['properties']['itemsLimitPerTable'])) {
-                       $this->itemsLimitPerTable = t3lib_div::intInRange(intval($this->modTSconfig['properties']['itemsLimitPerTable']), 1, 10000);
+                       $this->itemsLimitPerTable = t3lib_utility_Math::forceIntegerInRange(intval($this->modTSconfig['properties']['itemsLimitPerTable']), 1, 10000);
                }
                if(isset($this->modTSconfig['properties']['itemsLimitSingleTable'])) {
-                       $this->itemsLimitSingleTable = t3lib_div::intInRange(intval($this->modTSconfig['properties']['itemsLimitSingleTable']), 1, 10000);
+                       $this->itemsLimitSingleTable = t3lib_utility_Math::forceIntegerInRange(intval($this->modTSconfig['properties']['itemsLimitSingleTable']), 1, 10000);
                }
 
                        // Set select levels:
index 8a30fb1..185f7d7 100644 (file)
@@ -1620,7 +1620,7 @@ class localRecordList extends recordList {
 
                        // Compile the options into a multiple selector box:
                $lMenu = '
-                                                                               <select size="'.t3lib_div::intInRange(count($fields)+1,3,20).'" multiple="multiple" name="displayFields['.$table.'][]">'.implode('',$opt).'
+                                                                               <select size="'.t3lib_utility_Math::forceIntegerInRange(count($fields)+1,3,20).'" multiple="multiple" name="displayFields['.$table.'][]">'.implode('',$opt).'
                                                                                </select>
                                ';
 
index a4b1713..e5fd2bf 100644 (file)
@@ -185,7 +185,7 @@ class SC_file_newfolder {
 
                $code = '<form action="tce_file.php" method="post" name="editform">';
                        // Making the selector box for the number of concurrent folder-creations
-               $this->number = t3lib_div::intInRange($this->number,1,10);
+               $this->number = t3lib_utility_Math::forceIntegerInRange($this->number,1,10);
                $code .= '
                        <div id="c-select">
                                <label for="number-of-new-folders">' .
index 4c3c4f6..f0d53dc 100644 (file)
@@ -104,7 +104,7 @@ class SC_file_upload {
                if (empty($this->number)) {
                        $this->number = $GLOBALS['BE_USER']->getTSConfigVal('options.defaultFileUploads');
                }
-               $this->number = t3lib_div::intInRange($this->number, 1, $this->uploadNumber);
+               $this->number = t3lib_utility_Math::forceIntegerInRange($this->number, 1, $this->uploadNumber);
 
                        // Init basic-file-functions object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
index cbadc5d..898047a 100755 (executable)
@@ -984,7 +984,7 @@ class SC_db_layout {
                $dblist->no_noWrap = 1;
                $dblist->descrTable = $this->descrTable;
 
-               $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
+               $this->pointer = t3lib_utility_Math::forceIntegerInRange($this->pointer,0,100000);
                $dblist->script = 'db_layout.php';
                $dblist->showIcon = 0;
                $dblist->setLMargin=0;
@@ -993,7 +993,7 @@ class SC_db_layout {
 
                $dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
                $dblist->id = $this->id;
-               $dblist->nextThree = t3lib_div::intInRange($this->modTSconfig['properties']['editFieldsAtATime'],0,10);
+               $dblist->nextThree = t3lib_utility_Math::forceIntegerInRange($this->modTSconfig['properties']['editFieldsAtATime'],0,10);
                $dblist->option_showBigButtons = ($this->modTSconfig['properties']['disableBigButtons'] === '0');
                $dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
                $dblist->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0;
index b64f1c8..5bcb040 100644 (file)
@@ -4881,7 +4881,7 @@ class tslib_cObj {
                                                                }
                                                                        // Finish off
                                                                if (($fileArray['reduceColors'] || ($imgExt == 'png' && !$gifCreator->png_truecolor)) && is_file($dest)) {
-                                                                       $reduced = $gifCreator->IMreduceColors($dest, t3lib_div::intInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
+                                                                       $reduced = $gifCreator->IMreduceColors($dest, t3lib_utility_Math::forceIntegerInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
                                                                        if (is_file($reduced)) {
                                                                                unlink($dest);
                                                                                rename($reduced, $dest);
@@ -4892,7 +4892,7 @@ class tslib_cObj {
                                                                $fileArray['params'] = $this->modifyImageMagickStripProfileParameters($fileArray['params'], $fileArray);
                                                                $GLOBALS['TSFE']->tmpl->fileCache[$hash] = $gifCreator->imageMagickConvert($theImage, $fileArray['ext'], $fileArray['width'], $fileArray['height'], $fileArray['params'], $fileArray['frame'], $options);
                                                                if (($fileArray['reduceColors'] || ($imgExt == 'png' && !$gifCreator->png_truecolor)) && is_file($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
-                                                                       $reduced = $gifCreator->IMreduceColors($GLOBALS['TSFE']->tmpl->fileCache[$hash][3], t3lib_div::intInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
+                                                                       $reduced = $gifCreator->IMreduceColors($GLOBALS['TSFE']->tmpl->fileCache[$hash][3], t3lib_utility_Math::forceIntegerInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
                                                                        if (is_file($reduced)) {
                                                                                unlink($GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);
                                                                                rename($reduced, $GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);
@@ -7231,8 +7231,8 @@ class tslib_cObj {
                                $GLOBALS['TYPO3_DB']->sql_free_result($res);
                        }
                        if (!$error) {
-                               $conf['begin'] = t3lib_div::intInRange(ceil($this->calc($conf['begin'])), 0);
-                               $conf['max'] = t3lib_div::intInRange(ceil($this->calc($conf['max'])), 0);
+                               $conf['begin'] = t3lib_utility_Math::forceIntegerInRange(ceil($this->calc($conf['begin'])), 0);
+                               $conf['max'] = t3lib_utility_Math::forceIntegerInRange(ceil($this->calc($conf['max'])), 0);
                                if ($conf['begin'] && !$conf['max']) {
                                        $conf['max'] = 100000;
                                }
index 3070f4d..49e0683 100644 (file)
@@ -3566,7 +3566,7 @@ if (version == "n3") {
                        $shortTitle = $this->page['title'];
                }
 
-               $len = t3lib_div::intInRange($this->config['config']['stat_apache_pageLen'],1,100,30);
+               $len = t3lib_utility_Math::forceIntegerInRange($this->config['config']['stat_apache_pageLen'],1,100,30);
                if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
                        $shortTitle = rawurlencode($this->csConvObj->substr('utf-8',$shortTitle,0,$len));
                } else {
@@ -3587,7 +3587,7 @@ if (version == "n3") {
                                array_shift($temp);
                        }
 
-                       $len = t3lib_div::intInRange($this->config['config']['stat_titleLen'],1,100,20);
+                       $len = t3lib_utility_Math::forceIntegerInRange($this->config['config']['stat_titleLen'],1,100,20);
                        if ($this->config['config']['stat_apache_niceTitle'] == 'utf-8') {
                                $path = '';
                                $c = count($temp);
index 50b2c0d..9c0d725 100644 (file)
@@ -311,8 +311,8 @@ class tslib_gifBuilder extends t3lib_stdGraphic {
                                ? intval($this->cObj->stdWrap($this->setup['maxHeight'], $this->setup['maxHeight.']))
                                : intval($this->setup['maxHeight']);
 
-                       $XY[0] = t3lib_div::intInRange($XY[0],1, $maxWidth?$maxWidth:2000);
-                       $XY[1] = t3lib_div::intInRange($XY[1],1, $maxHeight?$maxHeight:2000);
+                       $XY[0] = t3lib_utility_Math::forceIntegerInRange($XY[0],1, $maxWidth?$maxWidth:2000);
+                       $XY[1] = t3lib_utility_Math::forceIntegerInRange($XY[1],1, $maxHeight?$maxHeight:2000);
                        $this->XY = $XY;
                        $this->w = $XY[0];
                        $this->h = $XY[1];
index 2f6063a..8e43c5b 100644 (file)
@@ -466,11 +466,11 @@ class tslib_menu {
                                                }
                                                $items=t3lib_div::intExplode(',',$value);
                                                if (t3lib_div::testInt($this->conf['special.']['depth']))       {
-                                                       $depth = t3lib_div::intInRange($this->conf['special.']['depth'],1,20);          // Tree depth
+                                                       $depth = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['depth'],1,20);                // Tree depth
                                                } else {
                                                        $depth=20;
                                                }
-                                               $limit = t3lib_div::intInRange($this->conf['special.']['limit'],0,100); // max number of items
+                                               $limit = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['limit'],0,100);       // max number of items
                                                $maxAge = intval(tslib_cObj::calc($this->conf['special.']['maxAge']));
                                                if (!$limit)    $limit=10;
                                                $mode = $this->conf['special.']['mode'];        // *'auto', 'manual', 'tstamp'
@@ -478,7 +478,7 @@ class tslib_menu {
                                                $id_list_arr = Array();
 
                                                foreach($items as $id)  {
-                                                       $bA = t3lib_div::intInRange($this->conf['special.']['beginAtLevel'],0,100);
+                                                       $bA = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['beginAtLevel'],0,100);
                                                        $id_list_arr[] = tslib_cObj::getTreeList(-1*$id,$depth-1+$bA,$bA-1);
                                                }
                                                $id_list = implode(',',$id_list_arr);
@@ -557,11 +557,11 @@ class tslib_menu {
 
                                                        // depth, limit, extra where
                                                if (t3lib_div::testInt($this->conf['special.']['depth']))       {
-                                                       $depth = t3lib_div::intInRange($this->conf['special.']['depth'],0,20);          // Tree depth
+                                                       $depth = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['depth'],0,20);                // Tree depth
                                                } else {
                                                        $depth=20;
                                                }
-                                               $limit = t3lib_div::intInRange($this->conf['special.']['limit'],0,100); // max number of items
+                                               $limit = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['limit'],0,100);       // max number of items
                                                $extraWhere = ' AND pages.uid!='.$value.($this->conf['includeNotInMenu'] ? '' : ' AND pages.nav_hide=0').$this->getDoktypeExcludeWhere();
                                                if ($this->conf['special.']['excludeNoSearchPages']) {
                                                        $extraWhere.= ' AND pages.no_search=0';
@@ -583,7 +583,7 @@ class tslib_menu {
 
                                                        // If there are keywords and the startuid is present.
                                                if ($kw && $startUid)   {
-                                                       $bA = t3lib_div::intInRange($this->conf['special.']['beginAtLevel'],0,100);
+                                                       $bA = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['beginAtLevel'],0,100);
                                                        $id_list=tslib_cObj::getTreeList(-1*$startUid,$depth-1+$bA,$bA-1);
 
                                                        $kwArr = explode(',',$kw);
@@ -2856,7 +2856,7 @@ class tslib_jsmenu extends tslib_menu {
        function writeMenu()    {
                if ($this->id)  {
                                // Making levels:
-                       $levels = t3lib_div::intInRange($this->mconf['levels'],1,5);
+                       $levels = t3lib_utility_Math::forceIntegerInRange($this->mconf['levels'],1,5);
                        $this->levels = $levels;
                        $uniqueParam = t3lib_div::shortMD5(microtime(), 5);
                        $this->JSVarName = 'eid' . $uniqueParam;
index 3fc552b..b201460 100644 (file)
@@ -116,7 +116,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'] === 'ascii') {
                        $GLOBALS['TSFE']->spamProtectEmailAddresses = 'ascii';
                } else {
-                       $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-10,10,0);
+                       $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'],-10,10,0);
                }
 
                $GLOBALS['TSFE']->absRefPrefix = ($GLOBALS['TSFE']->config['config']['absRefPrefix'] ? trim($GLOBALS['TSFE']->config['config']['absRefPrefix']) : '');
index 393858f..21c4827 100644 (file)
@@ -397,9 +397,9 @@ class tslib_pibase {
                        // Initializing variables:
                $pointer = intval($this->piVars[$pointerName]);
                $count = intval($this->internal['res_count']);
-               $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);
+               $results_at_a_time = t3lib_utility_Math::forceIntegerInRange($this->internal['results_at_a_time'],1,1000);
                $totalPages = ceil($count/$results_at_a_time);
-               $maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);
+               $maxPages = t3lib_utility_Math::forceIntegerInRange($this->internal['maxPages'],1,100);
                $pi_isOnlyFields = $this->pi_isOnlyFields($this->pi_isOnlyFields);
 
                if (!$forceOutput && $count <= $results_at_a_time) {
@@ -423,7 +423,7 @@ class tslib_pibase {
                                $pagefloat = ceil(($maxPages - 1)/2);
                        } else {
                                // pagefloat set as integer. 0 = left, value >= $this->internal['maxPages'] = right
-                               $pagefloat = t3lib_div::intInRange($this->internal['pagefloat'],-1,$maxPages-1);
+                               $pagefloat = t3lib_utility_Math::forceIntegerInRange($this->internal['pagefloat'],-1,$maxPages-1);
                        }
                } else {
                        $pagefloat = -1; // pagefloat disabled
@@ -452,7 +452,7 @@ class tslib_pibase {
                                $firstPage = max(0,$lastPage-$maxPages);
                        } else {
                                $firstPage = 0;
-                               $lastPage = t3lib_div::intInRange($totalPages,1,$maxPages);
+                               $lastPage = t3lib_utility_Math::forceIntegerInRange($totalPages,1,$maxPages);
                        }
                        $links=array();
 
@@ -1055,7 +1055,7 @@ class tslib_pibase {
                                // Limit data:
                        $pointer = $this->piVars['pointer'];
                        $pointer = intval($pointer);
-                       $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);
+                       $results_at_a_time = t3lib_utility_Math::forceIntegerInRange($this->internal['results_at_a_time'],1,1000);
                        $LIMIT = ($pointer*$results_at_a_time).','.$results_at_a_time;
 
                                // Add 'SELECT'
@@ -1148,7 +1148,7 @@ class tslib_pibase {
                                // Limit data:
                        $pointer = $this->piVars['pointer'];
                        $pointer = intval($pointer);
-                       $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'], 1, 1000);
+                       $results_at_a_time = t3lib_utility_Math::forceIntegerInRange($this->internal['results_at_a_time'], 1, 1000);
                        $LIMIT = ($pointer * $results_at_a_time) . ',' . $results_at_a_time;
 
                                // Add 'SELECT'
@@ -1189,13 +1189,13 @@ class tslib_pibase {
                        $pid_list = $GLOBALS['TSFE']->id;
                }
 
-               $recursive = t3lib_div::intInRange($recursive, 0);
+               $recursive = t3lib_utility_Math::forceIntegerInRange($recursive, 0);
 
                $pid_list_arr = array_unique(t3lib_div::trimExplode(',', $pid_list, 1));
                $pid_list     = array();
 
                foreach($pid_list_arr as $val) {
-                       $val = t3lib_div::intInRange($val, 0);
+                       $val = t3lib_utility_Math::forceIntegerInRange($val, 0);
                        if ($val) {
                                $_list = $this->cObj->getTreeList(-1 * $val, $recursive);
                                if ($_list) {
index f8a78a7..cc3962b 100644 (file)
@@ -49,7 +49,7 @@ class tslib_content_Columns extends tslib_content_Abstract {
                        $TDParams = isset($conf['TDParams.']) ? $this->cObj->stdWrap($conf['TDParams'], $conf['TDParams.']) : $conf['TDParams'];
                        $TDparams = $TDparams ? ' ' . $TDparams : ' valign="top"';
                        $rows = isset($conf['rows.']) ? $this->cObj->stdWrap($conf['rows'], $conf['rows.']) : $conf['rows'];
-                       $rows = t3lib_div::intInRange($rows, 2, 20);
+                       $rows = t3lib_utility_Math::forceIntegerInRange($rows, 2, 20);
                        $totalWidth = isset($conf['totalWidth.']) ? intval($this->cObj->stdWrap($conf['totalWidth'], $conf['totalWidth.'])) : intval($conf['totalWidth']);
                        $columnWidth = 0;
 
@@ -86,7 +86,7 @@ class tslib_content_Columns extends tslib_content_Abstract {
                                                $tdPar = $gapConf['gapBgCol'] ? ' bgcolor="' . $gapConf['gapBgCol'] . '"' : '';
                                                $gapLine = intval($gapConf['gapLineThickness']);
                                                if ($gapLine) {
-                                                       $gapSurround = t3lib_div::intInRange(($gapWidth - $gapLine) / 2, 1, 1000);
+                                                       $gapSurround = t3lib_utility_Math::forceIntegerInRange(($gapWidth - $gapLine) / 2, 1, 1000);
                                                        // right gap
                                                        $content .= '<td' . $tdPar . '><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' .
                                                                $gapSurround . '" height="1" alt="" title="" /></td>';
index 1fbe50b..3412923 100644 (file)
@@ -263,9 +263,9 @@ class tslib_content_Form extends tslib_content_Abstract {
                                                                                : $GLOBALS['TSFE']->compensateFieldWidth
                                                                        );
                                                $compWidth = $compWidth ? $compWidth : 1;
-                                               $cols = t3lib_div::intInRange($cols * $compWidth, 1, 120);
+                                               $cols = t3lib_utility_Math::forceIntegerInRange($cols * $compWidth, 1, 120);
 
-                                               $rows = trim($fParts[2]) ? t3lib_div::intInRange($fParts[2], 1, 30) : 5;
+                                               $rows = trim($fParts[2]) ? t3lib_utility_Math::forceIntegerInRange($fParts[2], 1, 30) : 5;
                                                $wrap = trim($fParts[3]);
                                                $noWrapAttr = isset($conf['noWrapAttr.'])
                                                        ? $this->cObj->stdWrap($conf['noWrapAttr'], $conf['noWrapAttr.'])
@@ -305,7 +305,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                                                                                : $GLOBALS['TSFE']->compensateFieldWidth
                                                                        );
                                                $compWidth = $compWidth ? $compWidth : 1;
-                                               $size = t3lib_div::intInRange($size * $compWidth, 1, 120);
+                                               $size = t3lib_utility_Math::forceIntegerInRange($size * $compWidth, 1, 120);
                                                $noValueInsert = isset($conf['noValueInsert.'])
                                                        ? $this->cObj->stdWrap($conf['noValueInsert'], $conf['noValueInsert.'])
                                                        : $conf['noValueInsert'];
@@ -319,7 +319,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                                                        $default = '';
                                                }
 
-                                               $max = trim($fParts[2]) ? ' maxlength="' . t3lib_div::intInRange($fParts[2], 1, 1000) . '"' : "";
+                                               $max = trim($fParts[2]) ? ' maxlength="' . t3lib_utility_Math::forceIntegerInRange($fParts[2], 1, 1000) . '"' : "";
                                                $theType = $confData['type'] == 'input' ? 'text' : 'password';
 
                                                $fieldCode = sprintf(
@@ -335,7 +335,7 @@ class tslib_content_Form extends tslib_content_Abstract {
 
                                        break;
                                        case 'file' :
-                                               $size = trim($fParts[1]) ? t3lib_div::intInRange($fParts[1], 1, 60) : 20;
+                                               $size = trim($fParts[1]) ? t3lib_utility_Math::forceIntegerInRange($fParts[1], 1, 60) : 20;
                                                $fieldCode = sprintf(
                                                        '<input type="file" name="%s"%s size="%s"%s />',
                                                        $confData['fieldname'],
@@ -371,7 +371,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                                                if (strtolower(trim($fParts[1])) == 'auto') {
                                                        $fParts[1] = count($valueParts);
                                                } // Auto size set here. Max 20
-                                               $size = trim($fParts[1]) ? t3lib_div::intInRange($fParts[1], 1, 20) : 1;
+                                               $size = trim($fParts[1]) ? t3lib_utility_Math::forceIntegerInRange($fParts[1], 1, 20) : 1;
                                                        // multiple
                                                $multiple = strtolower(trim($fParts[2])) == 'm' ? ' multiple="multiple"' : '';
 
index 7efe164..777d249 100644 (file)
@@ -45,7 +45,7 @@ class tslib_content_HorizontalRuler extends tslib_content_Abstract {
                $lineThickness = isset($conf['lineThickness.'])
                        ? $this->cObj->stdWrap($conf['lineThickness'], $conf['lineThickness.'])
                        : $conf['lineThickness'];
-               $lineThickness = t3lib_div::intInRange($lineThickness, 1, 50);
+               $lineThickness = t3lib_utility_Math::forceIntegerInRange($lineThickness, 1, 50);
 
                $lineColor = isset($conf['lineColor.'])
                        ? $this->cObj->stdWrap($conf['lineColor'], $conf['lineColor.'])
index 0474b5f..3f4de44 100644 (file)
@@ -62,7 +62,7 @@ class tslib_content_ImageText extends tslib_content_Abstract {
                                ? intval($this->cObj->stdWrap($conf['imgMax'], $conf['imgMax.']))
                                : intval($conf['imgMax']);
                        if ($imgMax) {
-                               $imgCount = t3lib_div::intInRange($imgCount, 0, $imgMax); // reduces the number of images.
+                               $imgCount = t3lib_utility_Math::forceIntegerInRange($imgCount, 0, $imgMax); // reduces the number of images.
                        }
 
                        $imgPath = isset($conf['imgPath.'])
index 1c88a63..1ed860f 100644 (file)
@@ -145,8 +145,8 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
                                $GLOBALS['TSFE']->register['SWORD_PARAMS'] = $search->get_searchwords();
 
                                $total = $search->res_count;
-                               $rangeLow = t3lib_div::intInRange($spointer + 1, 1, $total);
-                               $rangeHigh = t3lib_div::intInRange($spointer + $theRange, 1, $total);
+                               $rangeLow = t3lib_utility_Math::forceIntegerInRange($spointer + 1, 1, $total);
+                               $rangeHigh = t3lib_utility_Math::forceIntegerInRange($spointer + $theRange, 1, $total);
                                        // prev/next url:
 
                                $target = isset($conf['target.'])
index 56b1d02..8687e06 100755 (executable)
@@ -392,7 +392,7 @@ class user_feAdmin  {
                                                        if (is_array($this->dataArr[$theField]))        {
                                                                $val = 0;
                                                                foreach ($this->dataArr[$theField] as $kk => $vv) {
-                                                                       $kk = t3lib_div::intInRange($kk,0);
+                                                                       $kk = t3lib_utility_Math::forceIntegerInRange($kk,0);
                                                                        if ($kk<=30)    {
                                                                                if ($vv)        {
                                                                                        $val|=pow(2,$kk);
@@ -587,7 +587,7 @@ class user_feAdmin  {
                                        $recExist=1;
                                break;
                                default:
-                                       $recordTestPid = $this->thePid ? $this->thePid : t3lib_div::intval_positive($this->dataArr['pid']);
+                                       $recordTestPid = $this->thePid ? $this->thePid : t3lib_utility_Math::convertToPositiveInteger($this->dataArr['pid']);
                                break;
                        }
 
index 8ee1fb0..c0c25e3 100755 (executable)
@@ -141,12 +141,12 @@ class tslib_gmenu_foldout extends tslib_gmenu {
         * @return      string          Empty string! (Since $GLOBALS['TSFE']->divSection is set with the <div>-sections used in the menu)
         */
        function extProc_finish()       {
-               $bHeight = t3lib_div::intInRange(($this->mconf['bottomHeight']?$this->mconf['bottomHeight']:100) ,0,3000);
+               $bHeight = t3lib_utility_Math::forceIntegerInRange(($this->mconf['bottomHeight']?$this->mconf['bottomHeight']:100) ,0,3000);
                $bottomContent = $this->mconf['bottomContent'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($this->mconf['bottomContent'],$this->mconf['bottomContent.'], '/GMENU_FOLDOUT/.bottomContent') : '';
                $adjustTopHeights = intval($this->mconf['adjustItemsH']);
                $adjustSubHeights = intval($this->mconf['adjustSubItemsH']);
-               $mWidth = t3lib_div::intInRange(($this->mconf['menuWidth']?$this->mconf['menuWidth']:170) ,0,3000);
-               $mHeight = t3lib_div::intInRange(($this->mconf['menuHeight']?$this->mconf['menuHeight']:400) ,0,3000);
+               $mWidth = t3lib_utility_Math::forceIntegerInRange(($this->mconf['menuWidth']?$this->mconf['menuWidth']:170) ,0,3000);
+               $mHeight = t3lib_utility_Math::forceIntegerInRange(($this->mconf['menuHeight']?$this->mconf['menuHeight']:400) ,0,3000);
                $insertmColor= $this->mconf['menuBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['menuBackColor'].'; layer-background-color: '.$this->mconf['menuBackColor'] : '';
                $insertBottomColor= $this->mconf['bottomBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['bottomBackColor'].'; layer-background-color: '.$this->mconf['bottomBackColor'] : '';
                $menuOffset = t3lib_div::intExplode(',',$this->mconf['menuOffset'].',');
@@ -177,8 +177,8 @@ class tslib_gmenu_foldout extends tslib_gmenu {
 /*<![CDATA[*/
 <!--
 GFV_foldNumber='.$this->WMmenuItems.';          //How many toplinks do you have?
-GFV_foldTimer='.t3lib_div::intInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).';          //The timeout in the animation, these are milliseconds.
-GFV_foldSpeed='.t3lib_div::intInRange($this->mconf['foldSpeed'],1,100).';           //How many steps in an animation?
+GFV_foldTimer='.t3lib_utility_Math::forceIntegerInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).';          //The timeout in the animation, these are milliseconds.
+GFV_foldSpeed='.t3lib_utility_Math::forceIntegerInRange($this->mconf['foldSpeed'],1,100).';           //How many steps in an animation?
 GFV_stayFolded='.($this->mconf['stayFolded'] ? 'true' : 'false').';      //Stay open when you click a new toplink?
 GFV_foldImg='.$this->WMimagesFlag.';             //Do you want images (if not set to 0 and remove the images from the body)?
 GFV_currentFold=null;
index 987a59e..b94a376 100644 (file)
@@ -159,7 +159,7 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
+                               if (t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])        {
                                        $event.='GL_resetAll("'.$this->WMid.'");';
                                }
                                $this->I['linkHREF']['onMouseout'].=$event;
@@ -340,7 +340,7 @@ GLV_curLayerHeight["'.$this->WMid.'"]=0;
 GLV_curLayerX["'.$this->WMid.'"]=0;
 GLV_curLayerY["'.$this->WMid.'"]=0;
 GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
+GLV_gap["'.$this->WMid.'"]='.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
 GLV_currentLayer["'.$this->WMid.'"] = null;
 GLV_currentROitem["'.$this->WMid.'"] = null;
 GLV_hasBeenOver["'.$this->WMid.'"]=0;
@@ -351,7 +351,7 @@ GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?
 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
 GLV_date = new Date();
 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
+GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuTimer'],0,20000).';
 GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.implode(LF,$this->WMxyArray).'
 '.$this->WMrestoreVars;
index 0d9f0b6..4a2a67a 100644 (file)
@@ -279,22 +279,22 @@ class user_plaintext {
        function renderHeader($str,$type=0)     {
                if ($str)       {
                        $hConf = $this->conf['header.'];
-                       $defaultType = t3lib_div::intInRange($hConf['defaultType'],1,5);
-                       $type=t3lib_div::intInRange($type,0,6);
+                       $defaultType = t3lib_utility_Math::forceIntegerInRange($hConf['defaultType'],1,5);
+                       $type=t3lib_utility_Math::forceIntegerInRange($type,0,6);
                        if (!$type)     $type=$defaultType;
                        if ($type!=6)   {       // not hidden
                                $tConf = $hConf[$type.'.'];
 
                                $lines=array();
 
-                               $blanks = t3lib_div::intInRange($tConf['preBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['preBlanks'],0,1000);
                                if ($blanks)    {
                                        $lines[]=str_pad('', $blanks-1, chr(10));
                                }
 
                                $lines=$this->pad($lines,$tConf['preLineChar'],$tConf['preLineLen']);
 
-                               $blanks = t3lib_div::intInRange($tConf['preLineBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['preLineBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
 
                                if ($this->cObj->data['date'])  {
@@ -308,12 +308,12 @@ class user_plaintext {
                                $lines[]=$this->cObj->stdWrap($prefix.$str,$tConf['stdWrap.']);
                                if ($this->cObj->data['header_link'])           {$lines[] = $this->getString($hConf['linkPrefix']).$this->getLink($this->cObj->data['header_link']);}
 
-                               $blanks = t3lib_div::intInRange($tConf['postLineBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['postLineBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
 
                                $lines=$this->pad($lines,$tConf['postLineChar'],$tConf['postLineLen']);
 
-                               $blanks = t3lib_div::intInRange($tConf['postBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['postBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
                                return implode(chr(10),$lines);
                        }
@@ -330,7 +330,7 @@ class user_plaintext {
         * @see renderHeader()
         */
        function pad($lines,$preLineChar,$len)  {
-               $strPad = t3lib_div::intInRange($len,0,1000);
+               $strPad = t3lib_utility_Math::forceIntegerInRange($len,0,1000);
                $strPadChar = $preLineChar?$preLineChar:'-';
                if ($strPad)    {
                        $lines[]=str_pad('', $strPad, $strPadChar);
@@ -362,7 +362,7 @@ class user_plaintext {
         */
        function breakBulletlist($str)  {
                $type = $this->cObj->data['layout'];
-               $type=t3lib_div::intInRange($type,0,3);
+               $type=t3lib_utility_Math::forceIntegerInRange($type,0,3);
 
                $tConf = $this->conf['bulletlist.'][$type.'.'];
 
@@ -378,7 +378,7 @@ class user_plaintext {
 
                        $lines[]=$bullet.$this->breakLines($substrs,chr(10).$secondRow,$this->charWidth-$bLen);
 
-                       $blanks = t3lib_div::intInRange($tConf['blanks'],0,1000);
+                       $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['blanks'],0,1000);
                        if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
                }
                return implode(chr(10),$lines);
index ab028b6..587b452 100755 (executable)
@@ -122,7 +122,7 @@ foreach ($lines as $key => $content) {
        if ($content)   {
                $parts = explode('|',$content);
                $text = trim($parts[0]);
-               $type = t3lib_div::intInRange($parts[1],1,3);
+               $type = t3lib_utility_Math::forceIntegerInRange($parts[1],1,3);
                $link = trim($parts[2]);
                if ($text)      {
                        $imgConf = $conf['images.'][$type.'.'];
index 1310ae5..9a4776e 100644 (file)
@@ -159,7 +159,7 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
+                               if (t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])        {
                                        $event.='GL_resetAll("'.$this->WMid.'");';
                                }
                                $this->I['linkHREF']['onMouseout'].=$event;
@@ -340,7 +340,7 @@ GLV_curLayerHeight["'.$this->WMid.'"]=0;
 GLV_curLayerX["'.$this->WMid.'"]=0;
 GLV_curLayerY["'.$this->WMid.'"]=0;
 GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
+GLV_gap["'.$this->WMid.'"]='.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
 GLV_currentLayer["'.$this->WMid.'"] = null;
 GLV_currentROitem["'.$this->WMid.'"] = null;
 GLV_hasBeenOver["'.$this->WMid.'"]=0;
@@ -351,7 +351,7 @@ GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?
 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
 GLV_date = new Date();
 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
+GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuTimer'],0,20000).';
 GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.implode(LF,$this->WMxyArray).'
 '.$this->WMrestoreVars;
index 23df374..66fe964 100755 (executable)
@@ -108,7 +108,7 @@ class user_wapversion {
                        ));
 
                        $cParts = $this->contentAll();
-                       $pointer = t3lib_div::intInRange($GLOBALS['TSFE']->idParts[1],1,10000);
+                       $pointer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TSFE']->idParts[1],1,10000);
 
                        $msg='';
                        if ($pointer-1) {$msg.=$this->navLink(htmlspecialchars($conf['navLabels.']['prev']),$pointer-1).' ';}
index f3aae26..4bfbf4f 100644 (file)
@@ -213,8 +213,8 @@ class SC_tslib_showpic {
                        $max = '';
                }
 
-               $this->height = t3lib_div::intInRange($this->height,0);
-               $this->width = t3lib_div::intInRange($this->width,0);
+               $this->height = t3lib_utility_Math::forceIntegerInRange($this->height,0);
+               $this->width = t3lib_utility_Math::forceIntegerInRange($this->width,0);
                if ($this->frame) {
                        $this->frame = intval($this->frame);
                }
index 872388f..f87a0f4 100755 (executable)
@@ -155,7 +155,7 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase {
                        reset($rows);
 
                                // Find number of columns to render:
-                       $cols = t3lib_div::intInRange($this->cObj->data['cols']?$this->cObj->data['cols']:count(explode($delimiter,current($rows))),0,100);
+                       $cols = t3lib_utility_Math::forceIntegerInRange($this->cObj->data['cols']?$this->cObj->data['cols']:count(explode($delimiter,current($rows))),0,100);
 
                                // Traverse rows (rendering the table here)
                        $rCount = count($rows);
@@ -501,7 +501,7 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase {
                $imgCount = count($imgs) - $imgStart;
                $imgMax = intval($this->cObj->stdWrap($conf['imgMax'], $conf['imgMax.']));
                if ($imgMax)    {
-                       $imgCount = t3lib_div::intInRange($imgCount, 0, $imgMax);       // reduce the number of images.
+                       $imgCount = t3lib_utility_Math::forceIntegerInRange($imgCount, 0, $imgMax);     // reduce the number of images.
                }
 
                $imgPath = $this->cObj->stdWrap($conf['imgPath'], $conf['imgPath.']);
index f07cf42..60942f9 100644 (file)
@@ -123,7 +123,7 @@ class tx_em_Connection_ExtDirectServer {
                foreach ($list['data'] as $entry) {
                        $flatList[$entry['extkey']] = array(
                                'version' => $entry['version'],
-                               'intversion' => t3lib_div::int_from_ver($entry['version']),
+                               'intversion' => t3lib_utility_VersionNumber::convertVersionNumberToInteger($entry['version']),
                                'installed' => $entry['installed'],
                                'typeShort' => $entry['typeShort'],
                        );
index b871c2c..8a0b4de 100644 (file)
@@ -762,7 +762,7 @@ EXTENSION KEYS:
                                $comment = '<table cellpadding="0" cellspacing="0" width="100%">';
                                foreach ($versions as $vk) {
                                        $va = & $v[$vk];
-                                       if (t3lib_div::int_from_ver($vk) <= t3lib_div::int_from_ver($data['EM_CONF']['version'])) {
+                                       if (t3lib_utility_VersionNumber::convertVersionNumberToInteger($vk) <= t3lib_utility_VersionNumber::convertVersionNumberToInteger($data['EM_CONF']['version'])) {
                                                continue;
                                        }
                                        $comment .= '<tr><td valign="top" style="padding-right:2px;border-bottom:1px dotted gray">' . $vk . '</td>' . '<td valign="top" style="border-bottom:1px dotted gray">' . nl2br($va[uploadcomment]) . '</td></tr>';
index efb1a30..76c64f6 100644 (file)
@@ -436,9 +436,9 @@ final class tx_em_Tools {
         */
        public static function renderVersion($v, $raise = '') {
                $parts = t3lib_div::intExplode('.', $v . '..');
-               $parts[0] = t3lib_div::intInRange($parts[0], 0, 999);
-               $parts[1] = t3lib_div::intInRange($parts[1], 0, 999);
-               $parts[2] = t3lib_div::intInRange($parts[2], 0, 999);
+               $parts[0] = t3lib_utility_Math::forceIntegerInRange($parts[0], 0, 999);
+               $parts[1] = t3lib_utility_Math::forceIntegerInRange($parts[1], 0, 999);
+               $parts[2] = t3lib_utility_Math::forceIntegerInRange($parts[2], 0, 999);
 
                switch ((string) $raise) {
                        case 'main':
index b1eb879..cc517bd 100644 (file)
@@ -299,7 +299,7 @@ class tx_feedit_editpanel {
         */
        protected function editPanelPreviewBorder($table, array $row, $content, $thick, array $conf = array()) {
                if ($this->isDisabled($table, $row)) {
-                       $thick = t3lib_div::intInRange($thick, 1, 100);
+                       $thick = t3lib_utility_Math::forceIntegerInRange($thick, 1, 100);
                        $color = $conf['color'] ? $conf['color'] : '#cccccc';
                        if ($conf['innerWrap']) {
                                $content = $this->wrap($content,$conf['innerWrap']);
index 3c2fe16..365011f 100644 (file)
@@ -4,7 +4,7 @@ $_EXTCONF = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['felogin']
 
 t3lib_div::loadTCA('tt_content');
 
-if(t3lib_div::int_from_ver(TYPO3_version) >= 4002000)
+if(t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) >= 4002000)
        t3lib_extMgm::addPiFlexFormValue('*','FILE:EXT:'.$_EXTKEY.'/flexform.xml','login');
 else
        t3lib_extMgm::addPiFlexFormValue('default','FILE:EXT:'.$_EXTKEY.'/flexform.xml');
index b00e253..2f53d9b 100644 (file)
@@ -289,7 +289,7 @@ class SC_file_list {
                        }
 
                                // Start up filelisting object, include settings.
-                       $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
+                       $this->pointer = t3lib_utility_Math::forceIntegerInRange($this->pointer,0,100000);
                        $this->filelist->start($this->id, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
 
                                // Generate the list
index 30f008b..026e4b6 100755 (executable)
@@ -376,9 +376,9 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                        // BUILDING EXPORT DATA:
 
                        // Processing of InData array values:
-               $inData['pagetree']['maxNumber'] = t3lib_div::intInRange($inData['pagetree']['maxNumber'],1,10000,100);
-               $inData['listCfg']['maxNumber'] = t3lib_div::intInRange($inData['listCfg']['maxNumber'],1,10000,100);
-               $inData['maxFileSize'] = t3lib_div::intInRange($inData['maxFileSize'],1,10000,1000);
+               $inData['pagetree']['maxNumber'] = t3lib_utility_Math::forceIntegerInRange($inData['pagetree']['maxNumber'],1,10000,100);
+               $inData['listCfg']['maxNumber'] = t3lib_utility_Math::forceIntegerInRange($inData['listCfg']['maxNumber'],1,10000,100);
+               $inData['maxFileSize'] = t3lib_utility_Math::forceIntegerInRange($inData['maxFileSize'],1,10000,1000);
                $inData['filename'] = trim(preg_replace('/[^[:alnum:]._-]*/','',preg_replace('/\.(t3d|xml)$/','',$inData['filename'])));
                if (strlen($inData['filename']))        {
                        $inData['filename'].= $inData['filetype']=='xml' ? '.xml' : '.t3d';
@@ -451,7 +451,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                        foreach($inData['list'] as $ref)        {
                                $rParts = explode(':',$ref);
                                if ($GLOBALS['BE_USER']->check('tables_select',$rParts[0]))     {
-                                       $res = $this->exec_listQueryPid($rParts[0],$rParts[1],t3lib_div::intInRange($inData['listCfg']['maxNumber'],1));
+                                       $res = $this->exec_listQueryPid($rParts[0],$rParts[1],t3lib_utility_Math::forceIntegerInRange($inData['listCfg']['maxNumber'],1));
                                        while($subTrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))   {
                                                $this->export->export_addRecord($rParts[0],$subTrow);
                                        }
@@ -658,7 +658,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                        foreach ($GLOBALS['TCA'] as $table => $value) {
                                if ($table!='pages' && (in_array($table,$tables) || in_array('_ALL',$tables)))  {
                                        if ($GLOBALS['BE_USER']->check('tables_select',$table) && !$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
-                                               $res = $this->exec_listQueryPid($table,$k,t3lib_div::intInRange($maxNumber,1));
+                                               $res = $this->exec_listQueryPid($table,$k,t3lib_utility_Math::forceIntegerInRange($maxNumber,1));
                                                while($subTrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))   {
                                                        $this->export->export_addRecord($table,$subTrow);
                                                }
@@ -1623,7 +1623,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                        }
                        $opt[] = '<option value="'.htmlspecialchars($k).'"'.$sel.'>'.htmlspecialchars($v).'</option>';
                }
-               return '<select name="'.$prefix.'[]" multiple="multiple" size="'.t3lib_div::intInRange(count($opt),5,10).'">'.implode('',$opt).'</select>';
+               return '<select name="'.$prefix.'[]" multiple="multiple" size="'.t3lib_utility_Math::forceIntegerInRange(count($opt),5,10).'">'.implode('',$opt).'</select>';
        }
 
        /**
@@ -1649,7 +1649,7 @@ class SC_mod_tools_log_index extends t3lib_SCbase {
                                $opt[] = '<option value="'.htmlspecialchars($v).'"'.$sel.'>'.htmlspecialchars($v).'</option>';
                        }
                }
-               return '<select name="'.$prefix.'[]" multiple="multiple" size="'.t3lib_div::intInRange(count($opt),5,10).'">'.implode('',$opt).'</select>';
+               return '<select name="'.$prefix.'[]" multiple="multiple" size="'.t3lib_utility_Math::forceIntegerInRange(count($opt),5,10).'">'.implode('',$opt).'</select>';
        }
 
        /**
index df0e61c..dc453fe 100755 (executable)
@@ -257,7 +257,7 @@ class tx_indexedsearch_crawler {
 
                                // Init:
                        $pid = intval($cfgRec['alternative_source_pid']) ? intval($cfgRec['alternative_source_pid']) : $cfgRec['pid'];
-                       $numberOfRecords = $cfgRec['recordsbatch'] ? t3lib_div::intInRange($cfgRec['recordsbatch'],1) : 100;
+                       $numberOfRecords = $cfgRec['recordsbatch'] ? t3lib_utility_Math::forceIntegerInRange($cfgRec['recordsbatch'],1) : 100;
 
                                // Get root line:
                        $rl = $this->getUidRootLineForClosestTemplate($cfgRec['pid']);
@@ -745,8 +745,8 @@ class tx_indexedsearch_crawler {
                }
 
                        // Find last offset time plus frequency in seconds:
-               $lastSureOffset = $aMidNight+t3lib_div::intInRange($cfgRec['timer_offset'],0,86400);
-               $frequencySeconds = t3lib_div::intInRange($cfgRec['timer_frequency'],1);
+               $lastSureOffset = $aMidNight+t3lib_utility_Math::forceIntegerInRange($cfgRec['timer_offset'],0,86400);
+               $frequencySeconds = t3lib_utility_Math::forceIntegerInRange($cfgRec['timer_frequency'],1);
 
                        // Now, find out how many blocks of the length of frequency there is until the next time:
                $frequencyBlocksUntilNextTime = ceil(($currentTime-$lastSureOffset)/$frequencySeconds);
index 3e0ad12..b37f045 100755 (executable)
@@ -102,7 +102,7 @@ class tx_indexed_search_extparse {
                                                $this->app['pdfinfo'] = $pdfPath.'pdfinfo'.$exe;
                                                $this->app['pdftotext'] = $pdfPath.'pdftotext'.$exe;
                                                        // PDF mode:
-                                               $this->pdf_mode = t3lib_div::intInRange($indexerConfig['pdf_mode'],-100,100);
+                                               $this->pdf_mode = t3lib_utility_Math::forceIntegerInRange($indexerConfig['pdf_mode'],-100,100);
                                                $extOK = TRUE;
                                        } else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsNotFound'), $pdfPath), 3);
                                } else $this->pObj->log_setTSlogMessage($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsDisabled'), 1);
@@ -570,7 +570,7 @@ class tx_indexed_search_extparse {
                                        if ($this->pdf_mode>0)  {
                                                $iter = ceil($pdfInfo['pages']/$this->pdf_mode);
                                        } else {
-                                               $iter = t3lib_div::intInRange(abs($this->pdf_mode),1,$pdfInfo['pages']);
+                                               $iter = t3lib_utility_Math::forceIntegerInRange(abs($this->pdf_mode),1,$pdfInfo['pages']);
                                        }
 
                                                // Traverse and create intervals.
index 54be666..95e950a 100755 (executable)
@@ -346,10 +346,10 @@ class tx_indexedsearch_indexer {
 
                        // Indexer configuration from Extension Manager interface:
                $this->indexerConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['indexed_search']);
-               $this->tstamp_minAge = t3lib_div::intInRange($this->indexerConfig['minAge']*3600,0);
-               $this->tstamp_maxAge = t3lib_div::intInRange($this->indexerConfig['maxAge']*3600,0);
-               $this->maxExternalFiles = t3lib_div::intInRange($this->indexerConfig['maxExternalFiles'],0,1000,5);
-               $this->flagBitMask = t3lib_div::intInRange($this->indexerConfig['flagBitMask'],0,255);
+               $this->tstamp_minAge = t3lib_utility_Math::forceIntegerInRange($this->indexerConfig['minAge']*3600,0);
+               $this->tstamp_maxAge = t3lib_utility_Math::forceIntegerInRange($this->indexerConfig['maxAge']*3600,0);
+               $this->maxExternalFiles = t3lib_utility_Math::forceIntegerInRange($this->indexerConfig['maxExternalFiles'],0,1000,5);
+               $this->flagBitMask = t3lib_utility_Math::forceIntegerInRange($this->indexerConfig['flagBitMask'],0,255);
 
                        // Initialize external document parsers:
                        // Example configuration, see ext_localconf.php of this file!
@@ -1252,7 +1252,7 @@ class tx_indexedsearch_indexer {
        function bodyDescription($contentArr)   {
 
                        // Setting description
-               $maxL = t3lib_div::intInRange($this->conf['index_descrLgd'],0,255,200);
+               $maxL = t3lib_utility_Math::forceIntegerInRange($this->conf['index_descrLgd'],0,255,200);
                if ($maxL)      {
                                // Takes the quadruple lenght first, because whitespace and entities may be removed and thus shorten the string more yet.
        #               $bodyDescription = implode(' ',split('[[:space:],]+',substr(trim($contentArr['body']),0,$maxL*4)));
index 8a05aef..d09a0f0 100755 (executable)
@@ -170,7 +170,7 @@ class tx_indexedsearch extends tslib_pibase {
                        $this->piVars['sword'] = trim($this->piVars['sword_prev']).' '.$this->piVars['sword'];
                }
 
-               $this->piVars['results'] = t3lib_div::intInRange($this->piVars['results'],1,100000,$this->defaultResultNumber);
+               $this->piVars['results'] = t3lib_utility_Math::forceIntegerInRange($this->piVars['results'],1,100000,$this->defaultResultNumber);
 
                        // Selector-box values defined here:
                $this->optValues = Array(
@@ -504,7 +504,7 @@ class tx_indexedsearch extends tslib_pibase {
                if ($res)       {
 
                        $count = $GLOBALS['TYPO3_DB']->sql_num_rows($res);      // Total search-result count
-                       $pointer = t3lib_div::intInRange($this->piVars['pointer'], 0, floor($count/$this->piVars['results']));  // The pointer is set to the result page that is currently being viewed
+                       $pointer = t3lib_utility_Math::forceIntegerInRange($this->piVars['pointer'], 0, floor($count/$this->piVars['results']));        // The pointer is set to the result page that is currently being viewed
 
                                // Initialize result accumulation variables:
                        $c = 0; // Result pointer: Counts up the position in the current search-result
@@ -609,7 +609,7 @@ class tx_indexedsearch extends tslib_pibase {
                        if ($resData['count'])  {
                                $this->internal['res_count'] = $resData['count'];
                                $this->internal['results_at_a_time'] = $this->piVars['results'];
-                               $this->internal['maxPages'] = t3lib_div::intInRange($this->conf['search.']['page_links'],1,100,10);
+                               $this->internal['maxPages'] = t3lib_utility_Math::forceIntegerInRange($this->conf['search.']['page_links'],1,100,10);
                                $addString = ($resData['count']&&$this->piVars['group']=='sections'&&$freeIndexUid<=0 ? ' '.sprintf($this->pi_getLL(count($this->resultSections)>1?'inNsections':'inNsection'),count($this->resultSections)):'');
                                $browseBox1 = $this->pi_list_browseresults(1,$addString,$this->printResultSectionLinks(),$freeIndexUid);
                                $browseBox2 = $this->pi_list_browseresults(0,'','',$freeIndexUid);
@@ -1569,8 +1569,8 @@ class tx_indexedsearch extends tslib_pibase {
                        // Initializing variables:
                $pointer=$this->piVars['pointer'];
                $count=$this->internal['res_count'];
-               $results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);
-               $maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);
+               $results_at_a_time = t3lib_utility_Math::forceIntegerInRange($this->internal['results_at_a_time'],1,1000);
+               $maxPages = t3lib_utility_Math::forceIntegerInRange($this->internal['maxPages'],1,100);
                $pageCount = ceil($count/$results_at_a_time);
                $sTables = '';
 
@@ -1853,20 +1853,20 @@ class tx_indexedsearch extends tslib_pibase {
                                return $row['order_val'].' '.$this->pi_getLL('maketitle_matches');
                        break;
                        case 'rank_first':      // Close to top of page
-                               return ceil(t3lib_div::intInRange(255-$row['order_val'],1,255)/255*100).'%';
+                               return ceil(t3lib_utility_Math::forceIntegerInRange(255-$row['order_val'],1,255)/255*100).'%';
                        break;
                        case 'rank_flag':       // Based on priority assigned to <title> / <meta-keywords> / <meta-description> / <body>
                                if ($this->firstRow['order_val2'])      {
                                        $base = $row['order_val1']*256; // (3 MSB bit, 224 is highest value of order_val1 currently)
                                        $freqNumber = $row['order_val2']/$this->firstRow['order_val2']*pow(2,12);       // 15-3 MSB = 12
-                                       $total = t3lib_div::intInRange($base+$freqNumber,0,32767);
+                                       $total = t3lib_utility_Math::forceIntegerInRange($base+$freqNumber,0,32767);
                                        #debug($total);
                                        return ceil(log($total)/log(32767)*100).'%';
                                }
                        break;
                        case 'rank_freq':       // Based on frequency
                                $max = 10000;
-                               $total = t3lib_div::intInRange($row['order_val'],0,$max);
+                               $total = t3lib_utility_Math::forceIntegerInRange($row['order_val'],0,$max);
 #                              debug($total);
                                return ceil(log($total)/log($max)*100).'%';
                        break;
@@ -1945,7 +1945,7 @@ class tx_indexedsearch extends tslib_pibase {
 
                $occurencies = (count($parts)-1)/2;
                if ($occurencies)       {
-                       $postPreLgd = t3lib_div::intInRange($summaryMax/$occurencies,$postPreLgd,$summaryMax/2);
+                       $postPreLgd = t3lib_utility_Math::forceIntegerInRange($summaryMax/$occurencies,$postPreLgd,$summaryMax/2);
                }
 
                        // Variable:
index 8543be5..23eb331 100644 (file)
@@ -52,7 +52,7 @@ abstract class Tx_Install_Updates_Base {
 
        /**
         * current TYPO3 version number, set from outside
-        * version number coming from t3lib_div::int_from_ver()
+        * version number coming from t3lib_utility_VersionNumber::convertVersionNumberToInteger()
         */
        public $versionNumber;
 
index 06b02bf..daf807f 100755 (executable)
@@ -5116,7 +5116,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                        // Define the markers content
                                $imCommandsMarkers = array(
                                        'message' => 'ImageMagick commands executed:',
-                                       'rows' => t3lib_div::intInRange(count($commands), 2, 10),
+                                       'rows' => t3lib_utility_Math::forceIntegerInRange(count($commands), 2, 10),
                                        'commands' => htmlspecialchars(implode(LF, $commands))
                                );
                                        // Fill the markers in the subpart
@@ -5153,7 +5153,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                $commandsSubpart = t3lib_parsehtml::getSubpart($noImageSubpart, '###COMMANDSAVAILABLE###');
                                        // Define the markers content
                                $commandsMarkers = array(
-                                       'rows' => t3lib_div::intInRange(count($commands), 2, 10),
+                                       'rows' => t3lib_utility_Math::forceIntegerInRange(count($commands), 2, 10),
                                        'commands' => htmlspecialchars(implode(LF, $commands))
                                );
                                        // Fill the markers in the subpart
@@ -5962,7 +5962,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                                $statements = $this->sqlHandler->getStatementArray($fileContent, 1);
                                                $maxL = 1000;
                                                $strLen = strlen($fileContent);
-                                               $maxlen = 200+($maxL-t3lib_div::intInRange(($strLen-20000)/100,0,$maxL));
+                                               $maxlen = 200+($maxL-t3lib_utility_Math::forceIntegerInRange(($strLen-20000)/100,0,$maxL));
                                                if (count($statements)) {
                                                        $out = '';
                                                        foreach ($statements as $statement) {
@@ -6659,7 +6659,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
        function getUpgradeObjInstance($className, $identifier) {
                $tmpObj = t3lib_div::getUserObj($className);
                $tmpObj->setIdentifier($identifier);
-               $tmpObj->versionNumber = t3lib_div::int_from_ver(TYPO3_version);
+               $tmpObj->versionNumber = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
                $tmpObj->pObj = $this;
                $tmpObj->userInput = $this->INSTALL['update'][$identifier];
                return $tmpObj;
@@ -7145,7 +7145,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        break;
                        case 'group':
                                if ($fieldInfo['config']['internal_type']=='db') {
-                                       $max = t3lib_div::intInRange($fieldInfo['config']['maxitems'],1,10000);
+                                       $max = t3lib_utility_Math::forceIntegerInRange($fieldInfo['config']['maxitems'],1,10000);
                                        if (count(explode(',',$fieldInfo['config']['allowed']))>1) {
                                                        // Tablenames are 10, "_" 1, uid's 5, comma 1
                                                $len = $max*(10+1+5+1);
@@ -7159,14 +7159,14 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                        }
                                }
                                if ($fieldInfo['config']['internal_type']=='file') {
-                                       $max = t3lib_div::intInRange($fieldInfo['config']['maxitems'],1,10000);
+                                       $max = t3lib_utility_Math::forceIntegerInRange($fieldInfo['config']['maxitems'],1,10000);
                                                // Filenames is 30+ chars....
                                        $len = $max*(30+1);
                                        $out=$this->getItemBlobSize($len);
                                }
                        break;
                        case 'select':
-                               $max = t3lib_div::intInRange($fieldInfo['config']['maxitems'],1,10000);
+                               $max = t3lib_utility_Math::forceIntegerInRange($fieldInfo['config']['maxitems'],1,10000);
                                if ($max<=1) {
                                        if ($fieldInfo['config']['foreign_table']) {
                                                $out = "int(11) NOT NULL default '0'";
index a1e9661..c033044 100644 (file)
@@ -195,8 +195,8 @@ class tx_coreupdates_compatversion extends Tx_Install_Updates_Base {
                                return 1;
                        } else {
                                $performUpdate = 1;
-                               $oldVersion = t3lib_div::int_from_ver($TYPO3_CONF_VARS['SYS']['compat_version']);
-                               $currentVersion = t3lib_div::int_from_ver(TYPO3_branch);
+                               $oldVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger($TYPO3_CONF_VARS['SYS']['compat_version']);
+                               $currentVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_branch);
 
                                foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version'] as $internalName => $details)  {
                                        if ($details['version'] > $oldVersion && $details['version'] <= $currentVersion)        {
@@ -264,8 +264,8 @@ class tx_coreupdates_compatversion extends Tx_Install_Updates_Base {
         */
        function showChangesNeeded($inputPrefix = '')   {
                global $TYPO3_CONF_VARS;
-               $oldVersion = t3lib_div::int_from_ver($TYPO3_CONF_VARS['SYS']['compat_version']);
-               $currentVersion = t3lib_div::int_from_ver(TYPO3_branch);
+               $oldVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger($TYPO3_CONF_VARS['SYS']['compat_version']);
+               $currentVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_branch);
 
                $tableContents = '';
 
index 57d7727..50a7ec0 100644 (file)
@@ -105,8 +105,8 @@ class tx_coreupdates_cscsplit extends Tx_Install_Updates_Base {
         * @return      array           uid and inclusion string for the templates, that include csc and need an update
         */
        function findUpdateableTemplatesWithCsc($allTemplates) {
-               $compatVersion = t3lib_div::int_from_ver($GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version']);
-               $currentVersion = t3lib_div::int_from_ver(TYPO3_branch);
+               $compatVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger($GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version']);
+               $currentVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_branch);
 
                $templatesCount = count($allTemplates);
                $updateableTemplates = array();
@@ -117,32 +117,32 @@ class tx_coreupdates_cscsplit extends Tx_Install_Updates_Base {
                        // loop through every entry in the "include static file"
                        for ($j = 0; $j < $includedTemplatesCount; $j++) {
                                if (strpos($includedTemplates[$j], 'css_styled_content') !== FALSE) {
-                                       if ($compatVersion <= t3lib_div::int_from_ver('3.8')) {
+                                       if ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('3.8')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v3.8/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v3.8/';
                                                        $templateNeedsUpdate = TRUE;
                                                }
-                                       } elseif ($compatVersion <= t3lib_div::int_from_ver('4.1')) {
+                                       } elseif ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('4.1')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v3.9/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v3.9/';
                                                        $templateNeedsUpdate = TRUE;
                                                }
-                                       } elseif ($compatVersion <= t3lib_div::int_from_ver('4.2')) {
+                                       } elseif ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('4.2')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v4.2/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v4.2/';
                                                        $templateNeedsUpdate = TRUE;
                                                }
-                                       } elseif ($compatVersion <= t3lib_div::int_from_ver('4.3')) {
+                                       } elseif ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('4.3')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v4.3/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v4.3/';
                                                        $templateNeedsUpdate = TRUE;
                                                }
-                                       } elseif ($compatVersion <= t3lib_div::int_from_ver('4.4')) {
+                                       } elseif ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('4.4')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v4.4/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v4.4/';
                                                        $templateNeedsUpdate = TRUE;
                                                }
-                                       } elseif ($compatVersion <= t3lib_div::int_from_ver('4.5')) {
+                                       } elseif ($compatVersion <= t3lib_utility_VersionNumber::convertVersionNumberToInteger('4.5')) {
                                                if ($includedTemplates[$j] != 'EXT:css_styled_content/static/v4.5/') {
                                                        $includedTemplates[$j] = 'EXT:css_styled_content/static/v4.5/';
                                                        $templateNeedsUpdate = TRUE;
index fbd0223..b66eec9 100644 (file)
@@ -202,7 +202,7 @@ class tx_coreupdates_migrateworkspaces extends tx_coreupdates_installsysexts {
 
                $tables = array_keys($GLOBALS['TCA']);
                foreach ($tables as $table) {
-                       $versioningVer = t3lib_div::intInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
+                       $versioningVer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
                        if ($versioningVer > 0) {
                                if ($this->hasElementsOnWorkspace($table, -1)) {
                                        $foundDraftRecords = TRUE;
@@ -234,7 +234,7 @@ class tx_coreupdates_migrateworkspaces extends tx_coreupdates_installsysexts {
                if (!$workspacesWithReviewers && !empty($workspaceUids)) {
                        $tables = array_keys($GLOBALS['TCA']);
                        foreach ($tables as $table) {
-                               $versioningVer = t3lib_div::intInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
+                               $versioningVer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
                                if ($versioningVer > 0) {
                                        $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
                                                'uid',
@@ -287,7 +287,7 @@ class tx_coreupdates_migrateworkspaces extends tx_coreupdates_installsysexts {
                        't3ver_stage' => intval($newStageId)
                );
                foreach($tables as $table) {
-                       $versioningVer = t3lib_div::intInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
+                       $versioningVer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
                        if ($versioningVer > 0) {
                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $values);
                                $this->sqlQueries[] =  $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
@@ -336,7 +336,7 @@ class tx_coreupdates_migrateworkspaces extends tx_coreupdates_installsysexts {
                        't3ver_wsid' => intval($wsId)
                );
                foreach($tables as $table) {
-                       $versioningVer = t3lib_div::intInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
+                       $versioningVer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TCA'][$table]['ctrl']['versioningWS'], 0, 2, 0);
                        if ($versioningVer > 0 && $this->hasElementsOnWorkspace($table, -1)) {
                                $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $values);
                                $this->sqlQueries[] =  $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
index 2f4db04..c86ba85 100644 (file)
@@ -224,7 +224,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli {
         */
        function cli_printInfo($header,$res)    {
 
-               $detailLevel = t3lib_div::intInRange($this->cli_isArg('-v') ? $this->cli_argValue('-v') : 1,0,3);
+               $detailLevel = t3lib_utility_Math::forceIntegerInRange($this->cli_isArg('-v') ? $this->cli_argValue('-v') : 1,0,3);
                $silent = !$this->cli_echo();
 
                $severity = array(
@@ -558,7 +558,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli {
                                if (is_array($versions))        {
                                        foreach($versions as $verRec)   {
                                                if (!$verRec['_CURRENT_VERSION'])       {
-                                                       $this->genTree_traverse($verRec['uid'],$depth,$echoLevel,$callBack,'SWAPMODE:'.t3lib_div::intInRange($verRec['t3ver_swapmode'],-1,1),$versionSwapmode?2:1,$accumulatedPath.' [#OFFLINE VERSION: WS#'.$verRec['t3ver_wsid'].'/Cnt:'.$verRec['t3ver_count'].']');
+                                                       $this->genTree_traverse($verRec['uid'],$depth,$echoLevel,$callBack,'SWAPMODE:'.t3lib_utility_Math::forceIntegerInRange($verRec['t3ver_swapmode'],-1,1),$versionSwapmode?2:1,$accumulatedPath.' [#OFFLINE VERSION: WS#'.$verRec['t3ver_wsid'].'/Cnt:'.$verRec['t3ver_count'].']');
                                                }
                                        }
                                }
index c301986..40d96c0 100644 (file)
@@ -83,8 +83,8 @@ Cleaning XML for FlexForm fields.
                        'dirty' => array()
                );
 
-               $startingPoint = $this->cli_isArg('--pid') ? t3lib_div::intInRange($this->cli_argValue('--pid'),0) : 0;
-               $depth = $this->cli_isArg('--depth') ? t3lib_div::intInRange($this->cli_argValue('--depth'),0) : 1000;
+               $startingPoint = $this->cli_isArg('--pid') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--pid'),0) : 0;
+               $depth = $this->cli_isArg('--depth') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--depth'),0) : 1000;
 
                $this->cleanFlexForm_dirtyFields = &$resultArray['dirty'];
                $this->genTree_traverseDeleted = FALSE; // Do not repair flexform data in deleted records.
index fa3eca5..9793a04 100644 (file)
@@ -83,8 +83,8 @@ Although deleted records are not errors to be repaired, this tool allows you to
                        'deleted' => array(),
                );
 
-               $startingPoint = $this->cli_isArg('--pid') ? t3lib_div::intInRange($this->cli_argValue('--pid'),0) : 0;
-               $depth = $this->cli_isArg('--depth') ? t3lib_div::intInRange($this->cli_argValue('--depth'),0) : 1000;
+               $startingPoint = $this->cli_isArg('--pid') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--pid'),0) : 0;
+               $depth = $this->cli_isArg('--depth') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--depth'),0) : 1000;
                $this->genTree($startingPoint,$depth,(int)$this->cli_argValue('--echotree'));
 
                $resultArray['deleted'] = $this->recStats['deleted'];
index 639e06f..fdc4980 100644 (file)
@@ -96,8 +96,8 @@ Automatic Repair:
                        'versions' => array(),
                );
 
-               $startingPoint = $this->cli_isArg('--pid') ? t3lib_div::intInRange($this->cli_argValue('--pid'),0) : 0;
-               $depth = $this->cli_isArg('--depth') ? t3lib_div::intInRange($this->cli_argValue('--depth'),0) : 1000;
+               $startingPoint = $this->cli_isArg('--pid') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--pid'),0) : 0;
+               $depth = $this->cli_isArg('--depth') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--depth'),0) : 1000;
                $this->genTree($startingPoint,$depth,(int)$this->cli_argValue('--echotree'));
 
                $resultArray['versions'] = $this->recStats['versions'];
index f46709a..8bd2f6a 100644 (file)
@@ -279,7 +279,7 @@ class SC_db_list {
                        }
 
                                // Initialize the listing object, dblist, for rendering the list:
-                       $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
+                       $this->pointer = t3lib_utility_Math::forceIntegerInRange($this->pointer,0,100000);
                        $dblist->start($this->id,$this->table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
                        $dblist->setDispFields();
 
index 822e618..65b05fe 100644 (file)
@@ -56,7 +56,7 @@ class tx_reports_reports_status_Status {
                $this->value    = (string) $value;
                $this->message  = (string) $message;
 
-               $this->severity = t3lib_div::intInRange(
+               $this->severity = t3lib_utility_Math::forceIntegerInRange(
                        $severity,
                        self::NOTICE, self::ERROR, self::OK
                );
index e72592c..2311983 100644 (file)
@@ -205,7 +205,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        if (!$rteIsAvailable) {
                                $this->errorLog[] = 'RTE: Browser not supported.';
                        }
-                       if (t3lib_div::int_from_ver(TYPO3_version) < 4000000) {
+                       if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) < 4000000) {
                                $rteIsAvailable = FALSE;
                                $this->errorLog[] = 'rte: This version of htmlArea RTE cannot run under this version of TYPO3.';
                        }
@@ -236,7 +236,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                $inline = $this->TCEform->inline;
                $LANG->includeLLFile('EXT:' . $this->ID . '/locallang.xml');
                $this->client = $this->clientInfo();
-               $this->typoVersion = t3lib_div::int_from_ver(TYPO3_version);
+               $this->typoVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
                $this->userUid = 'BE_' . $GLOBALS['BE_USER']->user['uid'];
 
                        // Draw form element:
index bf6fd64..752cdaf 100644 (file)
@@ -337,8 +337,8 @@ class tx_rtehtmlarea_select_image extends browse_links {
                                        $destName = $fileFunc->getUniqueName($basename,$destPath);
                                        @copy($imgInfo[3],$destName);
                                        t3lib_div::fixPermissions($destName);
-                                       $cWidth = t3lib_div::intInRange(t3lib_div::_GP('cWidth'), 0, $this->magicMaxWidth);
-                                       $cHeight = t3lib_div::intInRange(t3lib_div::_GP('cHeight'), 0, $this->magicMaxHeight);
+                                       $cWidth = t3lib_utility_Math::forceIntegerInRange(t3lib_div::_GP('cWidth'), 0, $this->magicMaxWidth);
+                                       $cHeight = t3lib_utility_Math::forceIntegerInRange(t3lib_div::_GP('cHeight'), 0, $this->magicMaxHeight);
                                        if (!$cWidth)   $cWidth = $this->magicMaxWidth;
                                        if (!$cHeight)  $cHeight = $this->magicMaxHeight;
 
index 62860c0..18d9d8d 100644 (file)
@@ -73,7 +73,7 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
 
                $this->TCEform = $parentObject;
                $this->client = $this->clientInfo();
-               $this->typoVersion = t3lib_div::int_from_ver(TYPO3_version);
+               $this->typoVersion = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
 
                /* =======================================
                 * INIT THE EDITOR-SETTINGS
index 531e0a2..66da7dc 100644 (file)
@@ -394,7 +394,7 @@ class user_feAdmin  {
                                                        if (is_array($this->dataArr[$theField]))        {
                                                                $val = 0;
                                                                foreach ($this->dataArr[$theField] as $kk => $vv) {
-                                                                       $kk = t3lib_div::intInRange($kk,0);
+                                                                       $kk = t3lib_utility_Math::forceIntegerInRange($kk,0);
                                                                        if ($kk<=30)    {
                                                                                if ($vv)        {
                                                                                        $val|=pow(2,$kk);
@@ -589,7 +589,7 @@ class user_feAdmin  {
                                        $recExist=1;
                                break;
                                default:
-                                       $recordTestPid = $this->thePid ? $this->thePid : t3lib_div::intval_positive($this->dataArr['pid']);
+                                       $recordTestPid = $this->thePid ? $this->thePid : t3lib_utility_Math::convertToPositiveInteger($this->dataArr['pid']);
                                break;
                        }
 
index 35a0357..fc57f00 100644 (file)
@@ -142,12 +142,12 @@ class tslib_gmenu_foldout extends tslib_gmenu {
         * @return      string          Empty string! (Since $GLOBALS['TSFE']->divSection is set with the <div>-sections used in the menu)
         */
        function extProc_finish()       {
-               $bHeight = t3lib_div::intInRange(($this->mconf['bottomHeight']?$this->mconf['bottomHeight']:100) ,0,3000);
+               $bHeight = t3lib_utility_Math::forceIntegerInRange(($this->mconf['bottomHeight']?$this->mconf['bottomHeight']:100) ,0,3000);
                $bottomContent = $this->mconf['bottomContent'] ? $GLOBALS['TSFE']->cObj->cObjGetSingle($this->mconf['bottomContent'],$this->mconf['bottomContent.'], '/GMENU_FOLDOUT/.bottomContent') : '';
                $adjustTopHeights = intval($this->mconf['adjustItemsH']);
                $adjustSubHeights = intval($this->mconf['adjustSubItemsH']);
-               $mWidth = t3lib_div::intInRange(($this->mconf['menuWidth']?$this->mconf['menuWidth']:170) ,0,3000);
-               $mHeight = t3lib_div::intInRange(($this->mconf['menuHeight']?$this->mconf['menuHeight']:400) ,0,3000);
+               $mWidth = t3lib_utility_Math::forceIntegerInRange(($this->mconf['menuWidth']?$this->mconf['menuWidth']:170) ,0,3000);
+               $mHeight = t3lib_utility_Math::forceIntegerInRange(($this->mconf['menuHeight']?$this->mconf['menuHeight']:400) ,0,3000);
                $insertmColor= $this->mconf['menuBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['menuBackColor'].'; layer-background-color: '.$this->mconf['menuBackColor'] : '';
                $insertBottomColor= $this->mconf['bottomBackColor'] ? 'BACKGROUND-COLOR: '.$this->mconf['bottomBackColor'].'; layer-background-color: '.$this->mconf['bottomBackColor'] : '';
                $menuOffset = t3lib_div::intExplode(',',$this->mconf['menuOffset'].',');
@@ -178,8 +178,8 @@ class tslib_gmenu_foldout extends tslib_gmenu {
 /*<![CDATA[*/
 <!--
 GFV_foldNumber='.$this->WMmenuItems.';          //How many toplinks do you have?
-GFV_foldTimer='.t3lib_div::intInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).';          //The timeout in the animation, these are milliseconds.
-GFV_foldSpeed='.t3lib_div::intInRange($this->mconf['foldSpeed'],1,100).';           //How many steps in an animation?
+GFV_foldTimer='.t3lib_utility_Math::forceIntegerInRange(($this->mconf['foldTimer']?$this->mconf['foldTimer']:40) ,1,3000).';          //The timeout in the animation, these are milliseconds.
+GFV_foldSpeed='.t3lib_utility_Math::forceIntegerInRange($this->mconf['foldSpeed'],1,100).';           //How many steps in an animation?
 GFV_stayFolded='.($this->mconf['stayFolded'] ? 'true' : 'false').';      //Stay open when you click a new toplink?
 GFV_foldImg='.$this->WMimagesFlag.';             //Do you want images (if not set to 0 and remove the images from the body)?
 GFV_currentFold=null;
index 689688a..e214d3b 100644 (file)
@@ -160,7 +160,7 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
+                               if (t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])        {
                                        $event.='GL_resetAll("'.$this->WMid.'");';
                                }
                                $this->I['linkHREF']['onMouseout'].=$event;
@@ -341,7 +341,7 @@ GLV_curLayerHeight["'.$this->WMid.'"]=0;
 GLV_curLayerX["'.$this->WMid.'"]=0;
 GLV_curLayerY["'.$this->WMid.'"]=0;
 GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
+GLV_gap["'.$this->WMid.'"]='.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
 GLV_currentLayer["'.$this->WMid.'"] = null;
 GLV_currentROitem["'.$this->WMid.'"] = null;
 GLV_hasBeenOver["'.$this->WMid.'"]=0;
@@ -352,7 +352,7 @@ GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?
 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
 GLV_date = new Date();
 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
+GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuTimer'],0,20000).';
 GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.implode(LF,$this->WMxyArray).'
 '.$this->WMrestoreVars;
index 7866b81..e87f3fa 100644 (file)
@@ -281,22 +281,22 @@ class user_plaintext {
        function renderHeader($str,$type=0)     {
                if ($str)       {
                        $hConf = $this->conf['header.'];
-                       $defaultType = t3lib_div::intInRange($hConf['defaultType'],1,5);
-                       $type=t3lib_div::intInRange($type,0,6);
+                       $defaultType = t3lib_utility_Math::forceIntegerInRange($hConf['defaultType'],1,5);
+                       $type=t3lib_utility_Math::forceIntegerInRange($type,0,6);
                        if (!$type)     $type=$defaultType;
                        if ($type!=6)   {       // not hidden
                                $tConf = $hConf[$type.'.'];
 
                                $lines=array();
 
-                               $blanks = t3lib_div::intInRange($tConf['preBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['preBlanks'],0,1000);
                                if ($blanks)    {
                                        $lines[]=str_pad('', $blanks-1, chr(10));
                                }
 
                                $lines=$this->pad($lines,$tConf['preLineChar'],$tConf['preLineLen']);
 
-                               $blanks = t3lib_div::intInRange($tConf['preLineBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['preLineBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
 
                                if ($this->cObj->data['date'])  {
@@ -310,12 +310,12 @@ class user_plaintext {
                                $lines[]=$this->cObj->stdWrap($prefix.$str,$tConf['stdWrap.']);
                                if ($this->cObj->data['header_link'])           {$lines[] = $this->getString($hConf['linkPrefix']).$this->getLink($this->cObj->data['header_link']);}
 
-                               $blanks = t3lib_div::intInRange($tConf['postLineBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['postLineBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
 
                                $lines=$this->pad($lines,$tConf['postLineChar'],$tConf['postLineLen']);
 
-                               $blanks = t3lib_div::intInRange($tConf['postBlanks'],0,1000);
+                               $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['postBlanks'],0,1000);
                                if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
                                return implode(chr(10),$lines);
                        }
@@ -332,7 +332,7 @@ class user_plaintext {
         * @see renderHeader()
         */
        function pad($lines,$preLineChar,$len)  {
-               $strPad = t3lib_div::intInRange($len,0,1000);
+               $strPad = t3lib_utility_Math::forceIntegerInRange($len,0,1000);
                $strPadChar = $preLineChar?$preLineChar:'-';
                if ($strPad)    {
                        $lines[]=str_pad('', $strPad, $strPadChar);
@@ -365,7 +365,7 @@ class user_plaintext {
         */
        function breakBulletlist($str)  {
                $type = $this->cObj->data['layout'];
-               $type=t3lib_div::intInRange($type,0,3);
+               $type=t3lib_utility_Math::forceIntegerInRange($type,0,3);
 
                $tConf = $this->conf['bulletlist.'][$type.'.'];
 
@@ -382,7 +382,7 @@ class user_plaintext {
 
                        $lines[]=$bullet.$this->breakLines($substrs,chr(10).$secondRow,$this->charWidth-$bLen);
 
-                       $blanks = t3lib_div::intInRange($tConf['blanks'],0,1000);
+                       $blanks = t3lib_utility_Math::forceIntegerInRange($tConf['blanks'],0,1000);
                        if ($blanks)    {$lines[]=str_pad('', $blanks-1, chr(10));}
                }
                return implode(chr(10),$lines);
index ab028b6..587b452 100644 (file)
@@ -122,7 +122,7 @@ foreach ($lines as $key => $content) {
        if ($content)   {
                $parts = explode('|',$content);
                $text = trim($parts[0]);
-               $type = t3lib_div::intInRange($parts[1],1,3);
+               $type = t3lib_utility_Math::forceIntegerInRange($parts[1],1,3);
                $link = trim($parts[2]);
                if ($text)      {
                        $imgConf = $conf['images.'][$type.'.'];
index 4c453c6..464dc6f 100644 (file)
@@ -160,7 +160,7 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
-                               if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
+                               if (t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])        {
                                        $event.='GL_resetAll("'.$this->WMid.'");';
                                }
                                $this->I['linkHREF']['onMouseout'].=$event;
@@ -341,7 +341,7 @@ GLV_curLayerHeight["'.$this->WMid.'"]=0;
 GLV_curLayerX["'.$this->WMid.'"]=0;
 GLV_curLayerY["'.$this->WMid.'"]=0;
 GLV_menuOn["'.$this->WMid.'"] = null;
-GLV_gap["'.$this->WMid.'"]='.t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
+GLV_gap["'.$this->WMid.'"]='.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuWhenNotOver'],0,600).';
 GLV_currentLayer["'.$this->WMid.'"] = null;
 GLV_currentROitem["'.$this->WMid.'"] = null;
 GLV_hasBeenOver["'.$this->WMid.'"]=0;
@@ -352,7 +352,7 @@ GLV_dontHideOnMouseUp["'.$this->WMid.'"] = '.($this->mconf['dontHideOnMouseUp']?
 GLV_dontFollowMouse["'.$this->WMid.'"] = '.($this->mconf['dontFollowMouse']?1:0).';
 GLV_date = new Date();
 GLV_timeout["'.$this->WMid.'"] = GLV_date.getTime();
-GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_div::intInRange($this->mconf['hideMenuTimer'],0,20000).';
+GLV_timeoutRef["'.$this->WMid.'"] = '.t3lib_utility_Math::forceIntegerInRange($this->mconf['hideMenuTimer'],0,20000).';
 GLV_menuXY["'.$this->WMid.'"] = new Array();
 '.implode(LF,$this->WMxyArray).'
 '.$this->WMrestoreVars;
index e296cc6..f4910d9 100644 (file)
@@ -108,7 +108,7 @@ class user_wapversion {
                        ));
 
                        $cParts = $this->contentAll();
-                       $pointer = t3lib_div::intInRange($GLOBALS['TSFE']->idParts[1],1,10000);
+                       $pointer = t3lib_utility_Math::forceIntegerInRange($GLOBALS['TSFE']->idParts[1],1,10000);
 
                        $msg='';
                        if ($pointer-1) {$msg.=$this->navLink(htmlspecialchars($conf['navLabels.']['prev']),$pointer-1).' ';}
index bbe1868..4040e80 100644 (file)
@@ -929,7 +929,7 @@ class tx_sysaction_task implements tx_taskcenter_Task {
                        $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->taskObject->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current=='normal' && !$GLOBALS['BE_USER']->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
 
                                // Initialize the listing object, dblist, for rendering the list:
-                       $this->pointer = t3lib_div::intInRange($this->taskObject->pointer,0,100000);
+                       $this->pointer = t3lib_utility_Math::forceIntegerInRange($this->taskObject->pointer,0,100000);
                        $dblist->start($this->id,$this->table,$this->pointer,$this->taskObject->search_field,$this->taskObject->search_levels,$this->taskObject->showLimit);
                        $dblist->setDispFields();
 
index 137a5bb..b94f26a 100644 (file)
@@ -371,7 +371,7 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                $theOutput.= $this->pObj->doc->divider(5);
                        }
 
-                       #$numberOfRows= t3lib_div::intInRange($this->pObj->MOD_SETTINGS["ts_template_editor_TArows"],0,150);
+                       #$numberOfRows= t3lib_utility_Math::forceIntegerInRange($this->pObj->MOD_SETTINGS["ts_template_editor_TArows"],0,150);
                        #if (!$numberOfRows)
                        $numberOfRows = 35;
 
index 0b7d4ee..4007041 100644 (file)
@@ -119,7 +119,7 @@ class SC_tce_db {
                }
                if ($GLOBALS['BE_USER']->uc['copyLevels']) {
                                // Set to number of page-levels to copy.
-                       $this->tce->copyTree = t3lib_div::intInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
+                       $this->tce->copyTree = t3lib_utility_Math::forceIntegerInRange($GLOBALS['BE_USER']->uc['copyLevels'], 0, 100);
                }
                if ($GLOBALS['BE_USER']->uc['neverHideAtCopy']) {
                        $this->tce->neverHideAtCopy = 1;
index 4f7a743..0f94995 100644 (file)
@@ -102,7 +102,7 @@ class SC_wizard_table {
 
                        // Setting options:
                $this->xmlStorage = $this->P['params']['xmlOutput'];
-               $this->numNewRows = t3lib_div::intInRange($this->P['params']['numNewRows'],1,50,5);
+               $this->numNewRows = t3lib_utility_Math::forceIntegerInRange($this->P['params']['numNewRows'],1,50,5);
 
                        // Textareas or input fields:
                $this->inputStyle=isset($this->TABLECFG['textFields']) ? $this->TABLECFG['textFields'] : 1;