Skip to content

Conversation

@live-soft
Copy link
Collaborator

No description provided.

@live-soft live-soft requested a review from armanist January 13, 2026 12:43
*
* @return string
*/
function nav_ref_encode(): string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can accept string $query encode and return

* @param string|null $ref
* @return string|null
*/
function nav_ref_decode(?string $ref): ?string
Copy link
Member

@armanist armanist Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can handle whether put ? or not:

function nav_ref_decode(?string $ref): string
{
    if (!$ref) {
        return '';
    }

    $decoded = base64_decode(strtr($ref, '-_', '+/'), true);

    return ($decoded === false || $decoded === '')
        ? ''
        : '?' . $decoded;
}

@armanist armanist self-requested a review January 14, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants