コード例 #1
0
ファイル: paging.class.php プロジェクト: Cloudrexx/cloudrexx
 /**
  * Ensure that the used parameter name complies with the session
  * restrictions defined for variable keys, as the parameter name
  * is being used as a sesison-variable-key.
  * @param string $parameterName The name of the session-variable-key used to store the current paging position.
  * @return string $parameterName The sanitized session-variable-key.
  */
 private static function sanitizeParameterName($parameterName)
 {
     // Important: As the parameter name is used as a session-variable-key,
     // it must not exceed the allowed session-variable-key-length.
     // Therefore, if required, the parameter name is hashed and cut to the
     // maximum allowed session-variable-key-length.
     if (strlen($parameterName) > \Cx\Core\Session\Model\Entity\Session::getVariableKeyMaxLength()) {
         $parameterName = substr(md5($parameterName), 0, \Cx\Core\Session\Model\Entity\Session::getVariableKeyMaxLength());
     }
     return $parameterName;
 }