Code Duplication    Length = 6-6 lines in 2 locations

classes/autoptimizeUtils.php 2 locations

@@ 194-199 (lines=6) @@
191
     */
192
    protected static function iconv_substr( $s, $start, $length = null, $encoding = null )
193
    {
194
        if ( $start < 0 ) {
195
            $start = self::strlen( $s, $encoding ) + $start;
196
            if ( $start < 0 ) {
197
                $start = 0;
198
            }
199
        }
200
201
        if ( null === $length ) {
202
            $length = 2147483647;
@@ 203-208 (lines=6) @@
200
201
        if ( null === $length ) {
202
            $length = 2147483647;
203
        } elseif ( $length < 0 ) {
204
            $length = self::strlen( $s, $encoding ) + ( $length - $start );
205
            if ( $length < 0 ) {
206
                return '';
207
            }
208
        }
209
210
        return (string) ( null === $encoding ) ? \iconv_substr( $s, $start, $length ) : \iconv_substr( $s, $start, $length, $encoding );
211
    }