[BUGFIX] Wrong variable name used

The parameter is called $lgd but is used as $length.

Change-Id: Id5303562d4e3f9bd9222db585da6a5365588a031
Fixes: #46718
Releases: 6.1,6.0
Reviewed-on: https://review.typo3.org/19388
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer