# HG changeset patch # User Dan # Date 1237661734 14400 # Node ID ecc764c10138b2b0b6b24154fba4a6bd331eefb8 # Parent 0c3dd4c166c0e957ad5fa936d3bf1278050be28b# Parent e9ee4e246f966d06fc0326284014c0c9fbed13b7 Merging branches diff -r 0c3dd4c166c0 -r ecc764c10138 includes/pageprocess.php --- a/includes/pageprocess.php Sat Mar 21 14:33:22 2009 -0400 +++ b/includes/pageprocess.php Sat Mar 21 14:55:34 2009 -0400 @@ -463,7 +463,8 @@ // Set page_format $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id; - if ( $paths->pages[ $pathskey ]['page_format'] != $page_format ) + // Using @ due to warning thrown when saving new page + if ( @$paths->pages[ $pathskey ]['page_format'] !== $page_format ) { // Note: no SQL injection to worry about here. Everything that goes into this is sanitized already, barring some rogue plugin. // (and if there's a rogue plugin running, we have bigger things to worry about anyway.) diff -r 0c3dd4c166c0 -r ecc764c10138 includes/paths.php --- a/includes/paths.php Sat Mar 21 14:33:22 2009 -0400 +++ b/includes/paths.php Sat Mar 21 14:55:34 2009 -0400 @@ -142,13 +142,10 @@ { // This method really isn't supported because apache has a habit of passing dots as underscores, thus corrupting the request // If you really want to try it, the URI format is yoursite.com/?/Page_title - if ( count($_GET) > 0 ) + if ( !empty($_SERVER['QUERY_STRING']) && substr($_SERVER['QUERY_STRING'], 0, 1) == '/' ) { - list($getkey) = array_keys($_GET); - if ( substr($getkey, 0, 1) == '/' ) - { - $title = substr($getkey, 1); - } + $pos = ( ($_ = strpos($_SERVER['QUERY_STRING'], '&')) !== false ) ? $_ - 1: 0x7FFFFFFF; + $title = substr($_SERVER['QUERY_STRING'], 1, $pos); } } return ( $sanitize ) ? sanitize_page_id($title) : $title; diff -r 0c3dd4c166c0 -r ecc764c10138 install/includes/payload.php --- a/install/includes/payload.php Sat Mar 21 14:33:22 2009 -0400 +++ b/install/includes/payload.php Sat Mar 21 14:55:34 2009 -0400 @@ -192,6 +192,9 @@ case 'shortened': $sp_append = '/index.php/'; break; + case 'tiny': + $sp_append = '/?/'; + break; case 'rewrite': $sp_append = '/'; break; diff -r 0c3dd4c166c0 -r ecc764c10138 install/includes/stages/website.php --- a/install/includes/stages/website.php Sat Mar 21 14:33:22 2009 -0400 +++ b/install/includes/stages/website.php Sat Mar 21 14:55:34 2009 -0400 @@ -56,6 +56,20 @@ } else { + ajaxGet(scriptPath + '/install/install.php?/tiny&do=modrewrite_test', __ajaxMrwTest_chain_tiny); + } + } + } + var __ajaxMrwTest_chain_tiny = function() + { + if ( ajax.readyState == 4 ) + { + if ( ajax.responseText == 'good_tiny' ) + { + ajaxMrwSet('tiny'); + } + else + { ajaxGet(scriptPath + '/install/install.php?do=modrewrite_test&str=standard', __ajaxMrwTest_chain_standard); } } @@ -78,12 +92,13 @@ function ajaxMrwSet(level) { install_unset_ajax_loading(); - if ( !in_array(level, ['rewrite', 'shortened', 'standard']) ) + if ( !in_array(level, ['rewrite', 'shortened', 'standard', 'tiny']) ) return false; document.getElementById('url_radio_rewrite').checked = false; document.getElementById('url_radio_shortened').checked = false; document.getElementById('url_radio_standard').checked = false; + document.getElementById('url_radio_tiny').checked = false; document.getElementById('url_radio_' + level).checked = true; document.getElementById('url_radio_' + level).focus(); @@ -95,6 +110,9 @@ case 'shortened': var str = $lang.get('website_msg_bestmethod_shortened'); break; + case 'tiny': + var str = $lang.get('website_msg_bestmethod_tiny'); + break; case 'standard': var str = $lang.get('website_msg_bestmethod_standard'); break; @@ -264,6 +282,23 @@ + + + + + +
+ + + + +

get('website_field_urlscheme_opt_tiny_hint'); ?>

+

get('website_field_urlscheme_lbl_example'); ?>

+
+
+

get('website_btn_urlscheme_detect'); ?>

diff -r 0c3dd4c166c0 -r ecc764c10138 install/install.php --- a/install/install.php Sat Mar 21 14:33:22 2009 -0400 +++ b/install/install.php Sat Mar 21 14:55:34 2009 -0400 @@ -195,6 +195,10 @@ { echo 'good_' . $_GET['str']; } + else if ( $_SERVER['QUERY_STRING'] == '/tiny&do=modrewrite_test' ) + { + echo 'good_tiny'; + } else { echo 'bad'; diff -r 0c3dd4c166c0 -r ecc764c10138 language/english/install.json --- a/language/english/install.json Sat Mar 21 14:33:22 2009 -0400 +++ b/language/english/install.json Sat Mar 21 14:55:34 2009 -0400 @@ -248,6 +248,7 @@ msg_ajax_test_fail_body: 'None of the URL handling tests worked; you may have problems using Enano on your server.', msg_bestmethod_rewrite: 'The installer has detected that using rewritten URLs is the best level that will work.', msg_bestmethod_shortened: 'The installer has detected that using shortened URLs is the best level that will work.', + msg_bestmethod_tiny: 'The installer has detected that using tiny URLs is the best level that will work.', msg_bestmethod_standard: 'The installer has detected that using standard URLs is the only level that will work.', msg_modrewrite_enabled: 'Your copy of Enano has the Windows mod_rewrite workaround patch enabled.', msg_modrewrite_necessary: 'If you don\'t plan to use the Rewritten URLs option below, you should go back and re-download Enano without this workaround enabled. The mod_rewrite issues Enano faces under Windows are caused by a security change in Apache 2.2 that is not present in Apache 2.0. Learn more', @@ -270,6 +271,8 @@ field_urlscheme_opt_shortened_hint: 'This eliminates the "?title=" portion of your URL, and instead uses a slash. This is occasionally more friendly to search engines.', field_urlscheme_opt_rewrite: 'Rewritten URLs', field_urlscheme_opt_rewrite_hint: 'Using this option, you can completely eliminate the "index.php" from URLs. This is the most friendly option to search engines and looks very professional, but requires support for URL rewriting on your server. If you\'re running Apache and have the right permissions, Enano can configure this automatically. Otherwise, you\'ll need to configure your server manually and have a knowledge of regular expressions for this option to work.', + field_urlscheme_opt_tiny: '(Experimental) Tiny URLs', + field_urlscheme_opt_tiny_hint: 'This makes URLs very small - close to the size of Rewritten. However it doesn\'t work with every server, and we\'re still trying to experiment to find which servers it works with. If you can\'t use Rewritten URLs, you are encouraged to give this a try and let the Enano team know whether it works for you or not.', btn_urlscheme_detect: 'Auto-detect the best formatting scheme', objective_verify: 'Verify that your site information is correct. Again, all of the above settings can be changed from the administration panel.',