closed #5110, add const specifier to getStringLength function