120 if ( !count( $this->data[
'nowiki'] ) ) {
124 $callback =
function ( $m ) use ( $callback ) {
126 if ( isset( $this->data[
'nowiki'][$marker] ) ) {
127 $value = $this->data[
'nowiki'][$marker];
128 if ( $value instanceof Closure ) {
132 $this->expandSize += strlen( $value );
133 if ( $this->expandSize > $this->sizeLimit ) {
134 return $this->getLimitationWarning(
'unstrip-size', $this->sizeLimit );
137 return call_user_func( $callback, $value );
143 return preg_replace_callback( $this->regex, $callback, $text );
163 if ( !count( $this->data[
$type] ) ) {
167 $callback =
function ( $m ) use (
$type ) {
169 if ( isset( $this->data[
$type][$marker] ) ) {
170 if ( isset( $this->circularRefGuard[$marker] ) ) {
171 return $this->getWarning(
'parser-unstrip-loop-warning' );
174 if ( $this->depth > $this->highestDepth ) {
175 $this->highestDepth = $this->depth;
177 if ( $this->depth >= $this->depthLimit ) {
178 return $this->getLimitationWarning(
'unstrip-depth', $this->depthLimit );
181 $value = $this->data[
$type][$marker];
182 if ( $value instanceof Closure ) {
186 $this->expandSize += strlen( $value );
187 if ( $this->expandSize > $this->sizeLimit ) {
188 return $this->getLimitationWarning(
'unstrip-size', $this->sizeLimit );
191 $this->circularRefGuard[$marker] =
true;
193 $ret = $this->unstripType(
$type, $value );
195 unset( $this->circularRefGuard[$marker] );
203 $text = preg_replace_callback( $this->regex, $callback, $text );