Changeset 906


Ignore:
Timestamp:
Dec 9, 2006, 5:13:37 PM (15 years ago)
Author:
sheldon
Message:

Don't set the content to be non-blank when a document isn't found. The previous fix for passing null to wiki format broke the "we don't have that page do you want to create it" handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r901 r906  
    196196
    197197    # Fixes passing undefined values to Text::Wikiformat if node doesn't exist.
    198     my $raw        = $node_data{content} || " ";
    199     my $content    = $wiki->format($raw);
     198    my $content = '';
     199    if ($node_data{content}) {
     200        $content    = $wiki->format($node_data{content});
     201    }
     202
    200203    my $modified   = $node_data{last_modified};
    201204    my $moderated  = $node_data{moderated};
     
    207210                                        config => $config);
    208211    if ($args{format} && $args{format} eq 'raw') {
    209       print "Content-Type: text/plain\n\n";
    210       print $raw;
    211       return 0;
     212        print "Content-Type: text/plain\n\n";
     213        print $node_data{content};
     214        return 0;
    212215    }
    213216   
     
    241244        $tt_vars{catloc_link} = $config->script_name . "?id=";
    242245    }
    243 
    244     if ( $raw =~ /^#REDIRECT\s+(.+?)\s*$/ ) {
     246   
     247    if ( $node_data{content} && $node_data{content} =~ /^#REDIRECT\s+(.+?)\s*$/ ) {
    245248        my $redirect = $1;
    246249        # Strip off enclosing [[ ]] in case this is an extended link.
Note: See TracChangeset for help on using the changeset viewer.