ajax.php
changeset 1162 daa091452877
parent 1161 9c0c519066ac
child 1175 1e2c9819ede3
equal deleted inserted replaced
1161:9c0c519066ac 1162:daa091452877
    32       $page = new PageProcessor($paths->page_id, $paths->namespace, $revid);
    32       $page = new PageProcessor($paths->page_id, $paths->namespace, $revid);
    33       $page->password = $password;
    33       $page->password = $password;
    34       
    34       
    35       $have_draft = false;
    35       $have_draft = false;
    36       // Kinda hacky fix for issue 7: draft restore not offered for nonexistent pages
    36       // Kinda hacky fix for issue 7: draft restore not offered for nonexistent pages
    37       if ( $src = $page->fetch_source() || !$page->exists() )
    37       if ( ($src = $page->fetch_source()) || !$page->exists() )
    38       {
    38       {
    39         if ( !$page->exists() )
       
    40           $src = '';
       
    41         
       
    42         $allowed = true;
    39         $allowed = true;
    43         $q = $db->sql_query('SELECT author, time_id, page_text, edit_summary, page_format FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
    40         $q = $db->sql_query('SELECT author, time_id, page_text, edit_summary, page_format FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
    44                                AND page_id = \'' . $db->escape($paths->page_id) . '\'
    41                                AND page_id = \'' . $db->escape($paths->page_id) . '\'
    45                                AND namespace = \'' . $db->escape($paths->namespace) . '\'
    42                                AND namespace = \'' . $db->escape($paths->namespace) . '\'
    46                                AND is_draft = 1;');
    43                                AND is_draft = 1;');