示例#1
0
 /**
  * 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) > \cmsSession::getVariableKeyMaxLength()) {
         $parameterName = substr(md5($parameterName), 0, \cmsSession::getVariableKeyMaxLength());
     }
     return $parameterName;
 }