Merging branches
authorDan
Sat, 21 Mar 2009 14:55:34 -0400
changeset 878 ecc764c10138
parent 875 0c3dd4c166c0 (current diff)
parent 877 e9ee4e246f96 (diff)
child 879 9788f2b7e08a
Merging branches
install/includes/stages/website.php
language/english/install.json
--- 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.)
--- 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;
--- 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;
--- 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 @@
           </tr>
         </table>
         
+        <table border="0" cellpadding="10" cellspacing="0">
+          <tr>
+            <td valign="top">
+              <input type="radio" name="url_scheme" value="tiny" id="url_radio_tiny" tabindex="5" />
+            </td>
+            <td>
+              <label for="url_radio_tiny">
+                <b><?php echo $lang->get('website_field_urlscheme_opt_tiny'); ?></b>
+              </label>
+              <span id="hint_url_scheme_tiny" class="fieldtip">
+                <p><?php echo $lang->get('website_field_urlscheme_opt_tiny_hint'); ?></p>
+                <p><small><b><?php echo $lang->get('website_field_urlscheme_lbl_example'); ?></b> <tt><?php echo $scriptpath_full . '?/Page'; ?></tt></small></p>
+              </span>
+            </td>
+          </tr>
+        </table>
+        
         <p>
           <a href="#mrw_scan" onclick="ajaxMrwTest(); return false;" tabindex="4"><?php echo $lang->get('website_btn_urlscheme_detect'); ?></a>
         </p>
--- 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';
--- 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. <a href="http://enanocms.org/windows-patch" onclick="window.open(this.href); return false;">Learn more</a>',
@@ -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: '<span style="font-weight: bold; color: #a00;">(Experimental)</span> 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.',