includes/pageutils.php
changeset 361 35ed07abc99e
parent 360 fad9bb5c094b
child 372 5bd429428101
equal deleted inserted replaced
360:fad9bb5c094b 361:35ed07abc99e
   437     {
   437     {
   438       // echo '<b>Notice:</b> PageUtils::createPage: Prefix "Project:" is reserved<br />';
   438       // echo '<b>Notice:</b> PageUtils::createPage: Prefix "Project:" is reserved<br />';
   439       return 'The prefix "Project:" is reserved for a parser shortcut; if a page was created using this prefix, it would not be possible to link to it.';
   439       return 'The prefix "Project:" is reserved for a parser shortcut; if a page was created using this prefix, it would not be possible to link to it.';
   440     }
   440     }
   441     
   441     
       
   442     /*
       
   443     // Dunno why this was here. Enano can handle more flexible names than this...
       
   444     $regex = '#^([A-z0-9 _\-\.\/\!\@\(\)]*)$#is';
       
   445     if(!preg_match($regex, $name))
       
   446     {
       
   447       //echo '<b>Notice:</b> PageUtils::createPage: Name contains invalid characters<br />';
       
   448       return 'Name contains invalid characters';
       
   449     }
       
   450     */
       
   451     
   442     $page_id = dirtify_page_id($page_id);
   452     $page_id = dirtify_page_id($page_id);
   443     
   453     
   444     if ( !$name )
   454     if ( !$name )
   445       $name = str_replace('_', ' ', $page_id);
   455       $name = str_replace('_', ' ', $page_id);
   446     $regex = '#^([A-z0-9 _\-\.\/\!\@\(\)]*)$#is';
       
   447     if(!preg_match($regex, $name))
       
   448     {
       
   449       //echo '<b>Notice:</b> PageUtils::createPage: Name contains invalid characters<br />';
       
   450       return 'Name contains invalid characters';
       
   451     }
       
   452     
   456     
   453     $page_id = sanitize_page_id( $page_id );
   457     $page_id = sanitize_page_id( $page_id );
   454     
   458     
   455     $prot = ( $namespace == 'System' ) ? 1 : 0;
   459     $prot = ( $namespace == 'System' ) ? 1 : 0;
   456     
   460