当前位置: 首页>>代码示例>>PHP>>正文


PHP CommonFunctions::cleanAlphaNumericIdField方法代码示例

本文整理汇总了PHP中CommonFunctions::cleanAlphaNumericIdField方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::cleanAlphaNumericIdField方法的具体用法?PHP CommonFunctions::cleanAlphaNumericIdField怎么用?PHP CommonFunctions::cleanAlphaNumericIdField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommonFunctions的用法示例。


在下文中一共展示了CommonFunctions::cleanAlphaNumericIdField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

if (!isset($_GET['menu_no_top'])) {
    if ($_SESSION['isAdmin'] == 'Yes') {
        $_GET['menu_no_top'] = "hr";
    } else {
        if ($_SESSION['isSupervisor']) {
            $_GET['menu_no_top'] = "ess";
        } else {
            $_GET['menu_no_top'] = "ess";
        }
    }
}
/** Clean Get variables that are used in URLs in page */
$varsToClean = array('uniqcode', 'isAdmin', 'pageNo', 'id', 'repcode', 'reqcode', 'menu_no_top');
foreach ($varsToClean as $var) {
    if (isset($_GET[$var])) {
        $_GET[$var] = CommonFunctions::cleanAlphaNumericIdField($_GET[$var]);
    }
}
/* For checking TimesheetPeriodStartDaySet status : Begins */
//This should be change using $timesheetPeriodService->isTimesheetPeriodDefined() method to support symfony version of the timesheet period
if (Config::getTimePeriodSet()) {
    $_SESSION['timePeriodSet'] = 'Yes';
} else {
    $_SESSION['timePeriodSet'] = 'No';
}
/* For checking TimesheetPeriodStartDaySet status : Ends */
if ($_SESSION['isAdmin'] == 'Yes') {
    $rights = new Rights();
    foreach ($arrAllRights as $moduleCode => $currRights) {
        $arrAllRights[$moduleCode] = $rights->getRights($_SESSION['userGroup'], $moduleCode);
    }
开发者ID:rabbitdigital,项目名称:HRM,代码行数:31,代码来源:index.php

示例2: testCleanAlphaNumericIdField

 public function testCleanAlphaNumericIdField()
 {
     $this->assertEquals('223E3Ciframe3E3Cscript3Ealert28123293Cscript3E', CommonFunctions::cleanAlphaNumericIdField('%22%3E%3C/iframe%3E%3Cscript%3Ealert%28123%29;%3C/script%3E'));
     $this->assertEquals('alert123', CommonFunctions::cleanAlphaNumericIdField('"></iframe><script>alert(123);</script>'));
     $this->assertEquals('1', CommonFunctions::cleanAlphaNumericIdField('1'));
     $this->assertEquals('0721', CommonFunctions::cleanAlphaNumericIdField('0721'));
     $this->assertEquals('EAC', CommonFunctions::cleanAlphaNumericIdField('EAC'));
     $this->assertEquals('0', CommonFunctions::cleanAlphaNumericIdField('0'));
     $this->assertEquals('X_1', CommonFunctions::cleanAlphaNumericIdField('X_1'));
     $this->assertEquals('abc', CommonFunctions::cleanAlphaNumericIdField('abc'));
     $this->assertEquals('aZ_920diz1', CommonFunctions::cleanAlphaNumericIdField('aZ_920%$@diz 1!'));
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:12,代码来源:CommonFunctionsTest.php


注:本文中的CommonFunctions::cleanAlphaNumericIdField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。