Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation extension: forbidden colon (:) in URL #125

Open
ne0-cz opened this issue Mar 8, 2016 · 1 comment
Open

validation extension: forbidden colon (:) in URL #125

ne0-cz opened this issue Mar 8, 2016 · 1 comment

Comments

@ne0-cz
Copy link

ne0-cz commented Mar 8, 2016

Why is using of : (colon) forbidden in URL? Why should we thank to @vrana for that?

https://github.com/vojtech-dobes/nette.ajax.js/blob/master/nette.ajax.js#L332

How can I at least disable the default URL validation?

It seems to be introduced in commit fdbc555 (Local links (with hash) are never ajaxified) which doesn't state anything about colons. The thx to @vrana comment is not helpful at all.

Colon (:) is not seen really often but it is a possible character in URI path (see https://www.quora.com/Is-it-safe-to-use-a-colon-in-the-path-of-a-URL or http://tools.ietf.org/html/rfc3986).

@vojtech-dobes
Copy link
Owner

Hi, thx to @vrana is reference to http://php.vrana.cz/data/ajaxizace-webexpo.zip. Validation of URL can be disabled - it's partially described in Readme, but list of possible switches is unfortunately missing. Syntax in your case would be following:

<a n:href="hello" class="ajax" data-ajax-validate='{"url":false}'>Hello!</a>

Or in custom call:

$.nette.ajax({
    url: ...,
    validate: {
        url: false,
    },
});

But feel free to send PR if you think that validation should be done better.

I've also opened PR #126 where you can change defaults for validation extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants