Check-in [f442eb2ae2]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:f442eb2ae2e0ff8823dd696f26b034fd57e11deb
Date: 2010-03-18 14:11:20
User: drh
Comment:Fix some permissions problems on wiki pages. Always show "Empty Page" text for wiki pages that contain no text.
Tags And Properties
Changes

Changes to src/wiki.c

177 free(zTag); 177 free(zTag); 178 memset(&m, 0, sizeof(m)); 178 memset(&m, 0, sizeof(m)); 179 blob_zero(&m.content); 179 blob_zero(&m.content); 180 if( rid ){ 180 if( rid ){ 181 Blob content; 181 Blob content; 182 content_get(rid, &content); 182 content_get(rid, &content); 183 manifest_parse(&m, &content); 183 manifest_parse(&m, &content); 184 if( m.type==CFTYPE_WIKI ){ | 184 if( m.type==CFTYPE_WIKI && m.zWiki ){ > 185 while( isspace(m.zWiki[0]) ) m.zWiki++; 185 zBody = m.zWiki; | 186 if( m.zWiki[0] ) zBody = m.zWiki; 186 } 187 } 187 } 188 } 188 } 189 } 189 if( !g.isHome ){ 190 if( !g.isHome ){ 190 if( (rid && g.okWrWiki) || (!rid && g.okNewWiki) ){ 191 if( (rid && g.okWrWiki) || (!rid && g.okNewWiki) ){ 191 style_submenu_element("Edit", "Edit Wiki Page", "%s/wikiedit?name=%T", 192 style_submenu_element("Edit", "Edit Wiki Page", "%s/wikiedit?name=%T", 192 g.zTop, zPageName); 193 g.zTop, zPageName); 193 } 194 } 194 if( rid && g.okWrWiki && g.okAttach ){ | 195 if( rid && g.okApndWiki && g.okAttach ){ 195 style_submenu_element("Attach", "Add An Attachment", 196 style_submenu_element("Attach", "Add An Attachment", 196 "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", 197 "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", 197 g.zTop, zPageName, g.zTop, zPageName); 198 g.zTop, zPageName, g.zTop, zPageName); 198 } 199 } 199 if( rid && g.okApndWiki ){ 200 if( rid && g.okApndWiki ){ 200 style_submenu_element("Append", "Add A Comment", "%s/wikiappend?name=%T", 201 style_submenu_element("Append", "Add A Comment", "%s/wikiappend?name=%T", 201 g.zTop, zPageName); 202 g.zTop, zPageName); ................................................................................................................................................................................ 221 const char *zFile = db_column_text(&q, 1); 222 const char *zFile = db_column_text(&q, 1); 222 const char *zUser = db_column_text(&q, 2); 223 const char *zUser = db_column_text(&q, 2); 223 if( cnt==0 ){ 224 if( cnt==0 ){ 224 @ <hr><h2>Attachments:</h2> 225 @ <hr><h2>Attachments:</h2> 225 @ <ul> 226 @ <ul> 226 } 227 } 227 cnt++; 228 cnt++; > 229 if( g.okHistory ){ 228 @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> | 230 @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> > 231 }else{ > 232 @ <li> > 233 } 229 @ %h(zFile)</a> add by %h(zUser) on 234 @ %h(zFile)</a> add by %h(zUser) on 230 hyperlink_to_date(zDate, "."); 235 hyperlink_to_date(zDate, "."); 231 if( g.okWrWiki && g.okAttach ){ 236 if( g.okWrWiki && g.okAttach ){ 232 @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from 237 @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from 233 } 238 } 234 } 239 } 235 if( cnt ){ 240 if( cnt ){