includes/pageprocess.php
changeset 877 e9ee4e246f96
parent 832 7152ca0a0ce9
child 904 10076b28194b
equal deleted inserted replaced
876:aed15c337b72 877:e9ee4e246f96
   461       return false;
   461       return false;
   462     }
   462     }
   463     
   463     
   464     // Set page_format
   464     // Set page_format
   465     $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
   465     $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
   466     if ( $paths->pages[ $pathskey ]['page_format'] != $page_format )
   466     // Using @ due to warning thrown when saving new page
       
   467     if ( @$paths->pages[ $pathskey ]['page_format'] !== $page_format )
   467     {
   468     {
   468       // Note: no SQL injection to worry about here. Everything that goes into this is sanitized already, barring some rogue plugin.
   469       // Note: no SQL injection to worry about here. Everything that goes into this is sanitized already, barring some rogue plugin.
   469       // (and if there's a rogue plugin running, we have bigger things to worry about anyway.)
   470       // (and if there's a rogue plugin running, we have bigger things to worry about anyway.)
   470       if ( !$db->sql_query('UPDATE ' . table_prefix . "pages SET page_format = '$page_format' WHERE urlname = '$this->page_id' AND namespace = '$this->namespace';") )
   471       if ( !$db->sql_query('UPDATE ' . table_prefix . "pages SET page_format = '$page_format' WHERE urlname = '$this->page_id' AND namespace = '$this->namespace';") )
   471       {
   472       {