Skip to content

Commit

Permalink
Address Issue #1441
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffhumphrey committed Aug 9, 2023
1 parent fb578b7 commit 34a70e4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
4 changes: 2 additions & 2 deletions eval/process.eval.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
$evalFlavorScore = 0;
$evalMouthfeelScore = 0;

if ($_SESSION['prefsSEF'] == "Y") $sef = "true";
else $sef = "false";
if ($_SESSION['prefsSEF'] == "Y") $sef = TRUE;
else $sef = FALSE;

if ($view == "admin") $insertGoTo = $base_url."index.php?section=evaluation&go=default&filter=default&view=admin";
else $insertGoTo = build_public_url("evaluation","default","default","default",$sef,$base_url);
Expand Down
2 changes: 1 addition & 1 deletion includes/process.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
// echo $referrer['host']."<br>".$_SERVER['SERVER_NAME']; exit;
}

if ((isset($_SESSION['prefsSEF'])) && ($_SESSION['prefsSEF'] == "Y")) $sef = "true";
if ((isset($_SESSION['prefsSEF'])) && ($_SESSION['prefsSEF'] == "Y")) $sef = TRUE;

if (((isset($_SERVER['HTTP_REFERER'])) && ($referrer['host'] == $_SERVER['SERVER_NAME'])) && ((isset($_SESSION['prefs'.$prefix_session])) || ($setup_free_access))) {

Expand Down
36 changes: 15 additions & 21 deletions lib/common.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,32 +152,26 @@ function build_form_action($base_url,$section,$go,$action,$filter,$id,$dbTable,$
}

function build_public_url($section="default",$go="default",$action="default",$id="default",$sef,$base_url) {

include (CONFIG.'config.php');
if (NHC) {
$url = "index.php?section=".$section;

if ($_SESSION['prefsSEF'] == 'Y') {
$url = $base_url."";
if ($section != "default") $url .= $section."/";
if ($go != "default") $url .= $go."/";
if ($action != "default") $url .= $action."/";
if ($id != "default") $url .= $id."/";
return rtrim($url,"/");
}

else {
$url = $base_url."index.php?section=".$section;
if ($go != "default") $url .= "&amp;go=".$go;
if ($action != "default") $url .= "&amp;action=".$action;
if ($id != "default") $url .= "&amp;id=".$id;
return $url;
}
else {
if ($sef == "true") {
$url = $base_url."";
if ($section != "default") $url .= $section."/";
if ($go != "default") $url .= $go."/";
if ($action != "default") $url .= $action."/";
if ($id != "default") $url .= $id."/";
return rtrim($url,"/");
}
if ($sef == "false") {
$url = $base_url."index.php?section=".$section;
if ($go != "default") $url .= "&amp;go=".$go;
if ($action != "default") $url .= "&amp;action=".$action;
if ($id != "default") $url .= "&amp;id=".$id;
return $url;
}
}

}

/*
function build_admin_url ($section="default",$go="default",$action="default",$id="default",$filter="default",$view="default",$sef="true",$base_url) {
if ($sef == "true") {
Expand Down
4 changes: 0 additions & 4 deletions sections/nav.sec.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
*
*/

// Turn off SEF for error pages
if ($section >= 400) $sef = "false";
else $sef = $sef;

$add_entry_link_show = FALSE;
$show_entries = TRUE;
$nav_register_entrant_show = TRUE;
Expand Down
4 changes: 2 additions & 2 deletions site/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
require_once (LANG.'language.lang.php');
require_once (INCLUDES.'headers.inc.php');
require_once (INCLUDES.'scrubber.inc.php');
if ($_SESSION['prefsSEF'] == "Y") $sef = "true";
else $sef = "false";
if ($_SESSION['prefsSEF'] == "Y") $sef = TRUE;
else $sef = FALSE;

if ($no_updates_needed) $_SESSION['currentVersion'] = 1;
else $_SESSION['currentVersion'] = 0;
Expand Down

0 comments on commit 34a70e4

Please sign in to comment.