r104967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104966‎ | r104967 | r104968 >
Date:13:45, 2 December 2011
Author:ning
Status:deferred
Tags:
Comment:
enable template inside properties
Modified paths:
  • /trunk/extensions/WikiObjectModel/includes/models/WOM_OM_Property.php (modified) (history)
  • /trunk/extensions/WikiObjectModel/includes/parsers/WOMLinkParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiObjectModel/includes/models/WOM_OM_Property.php
@@ -34,7 +34,7 @@
3535 // FIXME: property should be collection object according to templates
3636 // if template/field used
3737 if ( preg_match( '/\{\{.+\}\}/s', $value . $caption ) ) {
38 - $value = "{$value}|{$caption}";
 38+ $value = $value . ( $caption == '' ? '' : "|{$caption}" );
3939 $caption = '';
4040 } else {
4141 if ( version_compare ( SMW_VERSION, '1.6', '>=' ) ) {
Index: trunk/extensions/WikiObjectModel/includes/parsers/WOMLinkParser.php
@@ -25,7 +25,7 @@
2626 return array( 'len' => strlen( $m[0] ), 'obj' => new WOMLinkModel( $m[1], isset( $m[3] ) ? $m[3] : '' ) );
2727 }
2828 // includes/Parser.php Parser->doMagicLinks
29 - $r = preg_match( '/^(?:' . wfUrlProtocols() . ')[^][<>"|\\x00-\\x20\\x7F]+/', $text, $m );
 29+ $r = preg_match( '/^(?:' . wfUrlProtocols() . ')[^][<>"|}{\\x00-\\x20\\x7F]+/', $text, $m );
3030 if ( $r ) {
3131 return array( 'len' => strlen( $m[0] ), 'obj' => new WOMLinkModel( $m[0] ) );
3232 }

Status & tagging log