Code Duplication    Length = 13-13 lines in 2 locations

class/utility.php 1 location

@@ 545-557 (lines=13) @@
542
         * @param int $offset
543
         * @return bool|int
544
         */
545
        public static function planetStrrPos($haystack, $needle, $offset = 0)
546
        {
547
            if (substr(PHP_VERSION, 0, 1) == 5) {
548
                return strrpos($haystack, $needle, $offset);
549
            }
550
            $index = strpos(strrev($haystack), strrev($needle));
551
            if ($index === false) {
552
                return false;
553
            }
554
            $index = strlen($haystack) - strlen($needle) - $index;
555
556
            return $index;
557
        }
558
    }
559
560
endif;

include/functions.php 1 location

@@ 537-549 (lines=13) @@
534
     * @param int $offset
535
     * @return bool|int
536
     */
537
    function planetStrrPos($haystack, $needle, $offset = 0)
538
    {
539
        if (substr(PHP_VERSION, 0, 1) == 5) {
540
            return strrpos($haystack, $needle, $offset);
541
        }
542
        $index = strpos(strrev($haystack), strrev($needle));
543
        if ($index === false) {
544
            return false;
545
        }
546
        $index = strlen($haystack) - strlen($needle) - $index;
547
548
        return $index;
549
    }
550
endif;
551