Several fixes - I hope - to prettyurls, still some issues on some servers, need to investigate this DIRNAME/ to DIRNAME.php

This commit is contained in:
real_nowhereman 2007-11-06 21:26:14 +00:00
parent d021b5f625
commit dea5876cbd
3 changed files with 10 additions and 11 deletions

View File

@ -13,8 +13,8 @@
'submit' => 'Save' 'submit' => 'Save'
); );
$lang['admin']['plugin']['prettyurls']['msgs'] = array( $lang['admin']['plugin']['prettyurls']['msgs'] = array(
1 => 'API key saved', 1 => '.htaccess saved successfully',
-1 => 'API key is not valid' -1 => '.htaccess could not be saved (do you have writing permissions on <code>'. BLOG_ROOT .'</code>)?'
); );
?> ?>

View File

@ -226,7 +226,11 @@ class Plugin_PrettyURLs {
if (strpos($_SERVER['REQUEST_URI'], BLOG_ROOT)!==false) { if (strpos($_SERVER['REQUEST_URI'], BLOG_ROOT)!==false) {
$url = substr($_SERVER['REQUEST_URI'], strlen(BLOG_ROOT)-1); $url = $_SERVER['REQUEST_URI'];
$del = BLOG_ROOT;
if (strpos($url, 'index.php')!==false)
$del = $del . 'index.php/';
$url = substr($url, strlen($del)-1);
} }
if ($url=='/') if ($url=='/')
@ -268,7 +272,6 @@ class Plugin_PrettyURLs {
if ($this->status == 2) if ($this->status == 2)
return; return;
if ($this->date_handled){ if ($this->date_handled){
$url = preg_replace_callback('|^/([^/]+)|', array(&$this, 'handle_entry'), $url); $url = preg_replace_callback('|^/([^/]+)|', array(&$this, 'handle_entry'), $url);
// if status = 2 // if status = 2
@ -502,9 +505,7 @@ STR;
function onsubmit() { function onsubmit() {
global $fp_config; global $fp_config;
if ($_POST['wp-apikey']){ if (!empty($_POST['htaccess']) && io_write_file(ABS_PATH.'.htaccess', $_POST['htaccess'])){
$this->smarty->assign('success', 1); $this->smarty->assign('success', 1);
} else { } else {
$this->smarty->assign('success', -1); $this->smarty->assign('success', -1);

View File

@ -4,9 +4,7 @@
{include file=shared:errorlist.tpl} {include file=shared:errorlist.tpl}
<form method="post" {html_form}
action="{$smarty.const.BLOG_BASEURL}admin.php?{$smarty.server.QUERY_STRING|escape:"html"}"
enctype="multipart/form-data">
<p> <p>
<textarea id="htaccess" name="htaccess" cols="70" rows="16">{$htaccess|escape:'html'}</textarea> <textarea id="htaccess" name="htaccess" cols="70" rows="16">{$htaccess|escape:'html'}</textarea>
@ -20,4 +18,4 @@
{/if} {/if}
</div> </div>
</form> {/html_form}