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'
);
$lang['admin']['plugin']['prettyurls']['msgs'] = array(
1 => 'API key saved',
-1 => 'API key is not valid'
1 => '.htaccess saved successfully',
-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) {
$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=='/')
@ -268,7 +272,6 @@ class Plugin_PrettyURLs {
if ($this->status == 2)
return;
if ($this->date_handled){
$url = preg_replace_callback('|^/([^/]+)|', array(&$this, 'handle_entry'), $url);
// if status = 2
@ -502,9 +505,7 @@ STR;
function onsubmit() {
global $fp_config;
if ($_POST['wp-apikey']){
if (!empty($_POST['htaccess']) && io_write_file(ABS_PATH.'.htaccess', $_POST['htaccess'])){
$this->smarty->assign('success', 1);
} else {
$this->smarty->assign('success', -1);

View File

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