PW protected album login: Warning

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

Comments

  • acrylian Administrator, Developer
    Zenphoto version? Theme used?
  • Did you re-run seup after redirecting your gallery?
  • It's Zenphoto 1.4.4 with gallery theme Default. The "Web path" is empty. I reran the setup but it didn't change.
  • 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.
  • 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();
    }
    }
  • acrylian Administrator, Developer
    Again, after moving did you run setup? You also might need to set the webpath in your config file (in zp-data) manually.
  • 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?
  • For your info, enabling mod_rewrite fixed the issue.

    Thanks for your investigation,
    Michael
Sign In or Register to comment.