Index: branches/REL1_3/phase3/RELEASE-NOTES |
— | — | @@ -6,6 +6,8 @@ |
7 | 7 | == Version 1.3.4, 2004-??-?? == |
8 | 8 | |
9 | 9 | Changes from 1.3.3: |
| 10 | +* Fixed lots of template-related bugs, esp. for cases where template |
| 11 | + variables are used for links, images, etc. |
10 | 12 | * Fixed transformation of page messages when viewing Special:Allmessages |
11 | 13 | * Handle "ISBN ISBN 1234" correctly |
12 | 14 | * Fixed warning on Category pages |
Index: branches/REL1_3/phase3/includes/Parser.php |
— | — | @@ -789,15 +789,6 @@ |
790 | 790 | return $t ; |
791 | 791 | } |
792 | 792 | |
793 | | - # Parses the text and adds the result to the strip state |
794 | | - # Returns the strip tag |
795 | | - function stripParse( $text, $newline, $args ) |
796 | | - { |
797 | | - $text = $this->strip( $text, $this->mStripState ); |
798 | | - $text = $this->internalParse( $text, (bool)$newline, $args, false ); |
799 | | - return $newline.$this->insertStripItem( $text, $this->mStripState ); |
800 | | - } |
801 | | - |
802 | 793 | function internalParse( $text, $linestart, $args = array(), $isMain=true ) { |
803 | 794 | $fname = 'Parser::internalParse'; |
804 | 795 | wfProfileIn( $fname ); |
— | — | @@ -1597,10 +1588,10 @@ |
1598 | 1589 | |
1599 | 1590 | if ( $this->mOutputType == OT_HTML ) { |
1600 | 1591 | # Argument substitution |
1601 | | - $text = preg_replace_callback( "/(\\n?){{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text ); |
| 1592 | + $text = preg_replace_callback( "/{{{([$titleChars]*?)}}}/", 'wfArgSubstitution', $text ); |
1602 | 1593 | } |
1603 | 1594 | # Template substitution |
1604 | | - $regex = '/(\\n?){{(['.$nonBraceChars.']*)(\\|.*?|)}}/s'; |
| 1595 | + $regex = '/{{(['.$nonBraceChars.']*)(\\|.*?|)}}/s'; |
1605 | 1596 | $text = preg_replace_callback( $regex, 'wfBraceSubstitution', $text ); |
1606 | 1597 | |
1607 | 1598 | array_pop( $this->mArgStack ); |
— | — | @@ -1653,15 +1644,13 @@ |
1654 | 1645 | |
1655 | 1646 | $title = NULL; |
1656 | 1647 | |
1657 | | - # $newline is an optional newline character before the braces |
1658 | 1648 | # $part1 is the bit before the first |, and must contain only title characters |
1659 | 1649 | # $args is a list of arguments, starting from index 0, not including $part1 |
1660 | 1650 | |
1661 | | - $newline = $matches[1]; |
1662 | | - $part1 = $matches[2]; |
1663 | | - # If the third subpattern matched anything, it will start with | |
| 1651 | + $part1 = $matches[1]; |
| 1652 | + # If the second subpattern matched anything, it will start with | |
1664 | 1653 | |
1665 | | - $args = $this->getTemplateArgs($matches[3]); |
| 1654 | + $args = $this->getTemplateArgs($matches[2]); |
1666 | 1655 | $argc = count( $args ); |
1667 | 1656 | |
1668 | 1657 | # {{{}}} |
— | — | @@ -1832,7 +1821,8 @@ |
1833 | 1822 | } |
1834 | 1823 | |
1835 | 1824 | # Run full parser on the included text |
1836 | | - $text = $this->stripParse( $text, $newline, $assocArgs ); |
| 1825 | + $text = $this->removeHTMLtags( $text ); |
| 1826 | + $text = $this->replaceVariables( $text, $assocArgs ); |
1837 | 1827 | |
1838 | 1828 | # Resume the link cache and register the inclusion as a link |
1839 | 1829 | if ( !is_null( $title ) ) { |
— | — | @@ -1850,13 +1840,13 @@ |
1851 | 1841 | |
1852 | 1842 | # Triple brace replacement -- used for template arguments |
1853 | 1843 | function argSubstitution( $matches ) { |
1854 | | - $newline = $matches[1]; |
1855 | | - $arg = trim( $matches[2] ); |
| 1844 | + $arg = trim( $matches[1] ); |
1856 | 1845 | $text = $matches[0]; |
1857 | 1846 | $inputArgs = end( $this->mArgStack ); |
1858 | 1847 | |
1859 | 1848 | if ( array_key_exists( $arg, $inputArgs ) ) { |
1860 | | - $text = $this->stripParse( $inputArgs[$arg], $newline, array() ); |
| 1849 | + $text = $this->removeHTMLtags( $inputArgs[$arg] ); |
| 1850 | + $text = $this->replaceVariables( $text, array() ); |
1861 | 1851 | } |
1862 | 1852 | |
1863 | 1853 | return $text; |