Member
Member
michael42   2013-01-20, 08:31
#1

I have redirected gallery.my.domain to my.domain/zenphoto/. Everything works fine. But if you want to access a password protected album you get these warnings after you have entered the (right) password:

Warning: strpos() [function.strpos]: Empty delimiter in .../html/zenphoto/zp-core/functions.php on line 1598

Warning: Cannot modify header information - headers already sent by (output started at .../html/zenphoto/zp-core/functions.php:1598) in .../html/zenphoto/zp-core/functions.php on line 1697

If you press the browsers back button now, the gallery is shown. Is there a setting I can do to get rid of these warnings?

Thanks,
Michael

Administrator
Administrator
acrylian   2013-01-20, 11:33
#2

Zenphoto version? Theme used?

Member
Member
sbillard   2013-01-20, 18:32
#3

Did you re-run seup after redirecting your gallery?

Member
Member
michael42   2013-01-20, 19:11
#4

It's Zenphoto 1.4.4 with gallery theme Default. The "Web path" is empty. I reran the setup but it didn't change.

Member
Member
sbillard   2013-01-20, 21:11
#5

If you ran setup from the web path mydomain/zenphoto it would have changed the webpath to "zenphoto" so you have not done this correctly. Things may work (but not mod-rewrite) with a wrong base, but certainly there will be issues.

You might want to install the support release. Your error line number does not correspond to any line in that release, which is all I have access to while I am traveling, so I cannot speculate on its cause.

Member
Member
michael42   2013-01-20, 22:59
#6

I moved ZP to the root. Same problem. hence I do not think it's a redirect issue. I asked my provider to enable mod_rewrite.

Here are the according 1.4.4 code snippets:

function sanitizeRedirect($redirectTo, $forceHost=false) {
$redirect = NULL;
if ($redirectTo && $redir = parse_url($redirectTo)) {
if (isset($redir['scheme']) && isset($redir['host'])) {
$redirect .= $redir['scheme'].'://'.sanitize($redir['host']);
} else {
if ($forceHost) {
$redirect .= SERVER_PROTOCOL.'://'.$_SERVER['HTTP_HOST'];
if(strpos($redirectTo, WEBPATH) === false) {
$redirect .= WEBPATH;
}

function zp_handle_password($authType=NULL, $check_auth=NULL, $check_user=NULL) {
...
$success = zp_apply_filter('guest_login_attempt', $success, $post_user, $post_pass, $authType);;
if ($success) {
// Correct auth info. Set the cookie.
if (DEBUG_LOGIN) debugLog("zp_handle_password: valid credentials");
zp_setCookie($authType, $auth);
if (isset($_POST['redirect'])) {
$redirect_to = sanitizeRedirect($_POST['redirect'], true);
if (!empty($redirect_to)) {
header("Location: " . $redirect_to);
exitZP();
}
}

Administrator
Administrator
acrylian   2013-01-21, 11:36
#7

Again, after moving did you run setup? You also might need to set the webpath in your config file (in zp-data) manually.

Member
Member
michael42   2013-01-21, 21:44
#8

Yes I re-ran the setup. Once approved to the gallery everything is ok. Also if you re-open the website at a later date (until the cookie is still valid of course). Hence I think the "webpath" is not the issue, isn't it?

Member
Member
michael42   2013-01-22, 19:04
#9

For your info, enabling mod_rewrite fixed the issue.

Thanks for your investigation,
Michael

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.