Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter RayBernard

    (@raybernard)

    FOUND THE ISSUE. When my hosting provider said that the PHP versions WERE compiled with the advanced hash algorithm support, I looked deeper and found the issue.

    A change to the function password_hash() in PHP 7.4.0 invalidated one line of code in the Better Passwords function better_pass_check_algorithm(). The function’s purpose is to verify that the algorithm is defined as a constant in the environment before allowing it to be enabled. Good coding, but it got invalidated.

    The PASSWORD_BCRYPT, PASSWORD_ARGON2I and PASSWORD_ARGON2ID constants used to be defined as integers but now are strings. The PHP password_hash() function still accepts integers for backwards compatibility, but the constants are now defined as strings.

    Thus, when the better_pass_check_algorithm() function assigns an advanced algorithm constant to $alg and then uses is_int($alg)) to checks for it, the validation always fails. The plugin doesn’t perform that check for PASSWORD_BCRYPT, because it’s already known to be there. Hence the two disabled advanced algorithm selections on the plugin’s Settings page.

    In better-passwords.php – in the better_pass_check_algorithm() – I modified line 214 from:

    if(is_int($alg)) {

    to:

    if(is_int($alg) or is_string($alg)) {

    and now all three algorithm selections are enabled on the Settings page.

    Thread Starter RayBernard

    (@raybernard)

    richalt2 – thanks! Of course that did the trick.

    You can define a custom format that will show only the title.

    In the Dashboard, go to Downloads, Configuration to define a Custom Output Format in the Add Format section.

    The example code below is for custom output format #1 defined like this (the Name field could be any name):

    Name: List with No Counts
    Format:<a href="{url}" class="downloadlink" title="{version} downloaded {hits} times">{title}</a>

    In your page you would list the files this way:

    [downloads format="1"]

    This should produce the same HTML output you have now except that the download count would not appear in the list.

    I hope this helps.
    Ray

Viewing 3 replies - 1 through 3 (of 3 total)