getOptions($options, $cfg['DefaultTransformations']['Substring']); $optionZero = (int) $options[0]; if ($options[1] !== 'all') { $newtext = mb_substr((string) $buffer, $optionZero, (int) $options[1]); } else { $newtext = mb_substr((string) $buffer, $optionZero); } $length = mb_strlen($newtext); $baselength = mb_strlen((string) $buffer); if ($length != $baselength) { if ($optionZero !== 0) { $newtext = $options[2] . $newtext; } if ($length + $optionZero != $baselength) { $newtext .= $options[2]; } } return htmlspecialchars($newtext); } /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ /** * Gets the transformation name of the specific plugin * * @return string */ public static function getName() { return 'Substring'; } }