1 ) { $replace = self::replace( $match, $parser, $isOffAnnotation ); $text = str_replace( $match, $replace, $text ); } } return $text; } private static function replace( $match, $parser, $isOffAnnotation = false ) { // Remove the Leading and last square bracket to avoid distortion // during the annotation parsing $match = substr( substr( $match, 2 ), 0, -2 ); // Restore OFF/ON for the recursive processing if ( $isOffAnnotation === true ) { $match = InTextAnnotationParser::OFF . $match . InTextAnnotationParser::ON; } // Only match annotations of style [[...::...]] during a recursive // obfuscation process, any other processing is being done by the // InTextAnnotation parser hereafter // // [[Foo::Bar]] annotation therefore run a pattern match and // obfuscate the returning [[, |, ]] result $replace = self::encodeLinks( preg_replace_callback( LinksProcessor::getRegexpPattern( false ), [ $parser, 'preprocess' ], $match ) ); // Restore the square brackets return '[[' . $replace . ']]'; } }