Plugin Directory

Changeset 370924


Ignore:
Timestamp:
04/09/2011 03:57:41 PM (15 years ago)
Author:
beatpanda
Message:

Added patch to fix TOC

Location:
wordpress-wiki/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wordpress-wiki/trunk/controllers/wiki_pages.php

    r348407 r370924  
    7676        $last_h2_pos = explode('</h2>', $content);
    7777        $last_h2_pos = array_pop($last_h2_pos);
    78         $last_h2_pos[1] = $last_h2_pos;
    79         $h3s_contents[1][] = $last_h2_pos;
    80         if (!is_array($h3s_contents[1])) {
     78        if(!empty($last_h2_pos)){
     79            $last_h2_pos[1] = $last_h2_pos;
     80            $h3s_contents[1][] = $last_h2_pos;
     81        }
     82        if (empty($h3s_contents[1])) {
    8183            $h3s_contents[1] = array();
    8284        }
    8385        array_push($h3s_contents[1], $last_h2_pos);
    84         foreach ($h3s_contents[1] as $key => $h3s_content) {
    85             preg_match_all("|<h3>(.*)</h3>|U", $h3s_content, $h3s[$key], PREG_PATTERN_ORDER);
    86         }
     86            foreach ($h3s_contents[1] as $key => $h3s_content) {
     87                preg_match_all("|<h3>(.*)</h3>|U", $h3s_content, $h3s[$key], PREG_PATTERN_ORDER);
     88            }
    8789        $table = "<ol class='content_list'>";
    8890        foreach($h2s as $key => $h2) {
  • wordpress-wiki/trunk/wordpress-wiki.php

    r348410 r370924  
    1717        global $wp_version;
    1818        /**
    19         * Guess the wp-content and plugin urls/paths
     19        * Todo: There is no need to guess the wp-content folder any more...
    2020        */
     21       
    2122        if ( !defined('WP_CONTENT_URL') )
    2223            define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
Note: See TracChangeset for help on using the changeset viewer.