developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 12 years ago

Closed 12 years ago

#743 closed bug (fixed)

jForms: server side check for <input type="url"> doesn't work

Reported by: Julien Owned by: Julien
Priority: normal Milestone: jelix 1.1
Component: jelix:forms Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

in a form :

<input ref="website" type="url">
    <label>Website URL</label>
</input>

enter value "foobar"

Javascript check works well, but server side check passes without any warning.

We should have the same behavior as in Javascript, the attached patch could be a way to do it.

Attachments (1)

743-jForms-server-side-check-for-url.diff (3.2 KB) - added by Julien 12 years ago.

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by Julien

comment:1 Changed 12 years ago by Julien

  • Status changed from new to assigned

comment:2 Changed 12 years ago by Julien

  • Milestone set to jelix 1.1

comment:3 Changed 12 years ago by laurentj

I agree it does make sens to have shemaRequired and hostRequired by default. Then perhaps we could define this facets directly inside jDatatypeUrl ?

comment:4 Changed 12 years ago by laurentj

I think we have the same bug in 1.0.x. For 1.0.x, do not set shemaRequired and hostRequired. We shouldn't change the behavior in 1.0.x.

comment:5 Changed 12 years ago by Julien

Yes we could.

I made it that way because I didn't check if jDatatypeUrl was used elsewhere in Jelix, so it was the safest way to keep everything working right.

If we do so, some developers may have use it in apps too, so we should notify the api change clearly in the changelog.

As you just said, we should backport the change to 1.0.x too, so I think we should not change the default values for jDatatypeUrl, for compatibility.

comment:6 Changed 12 years ago by Julien

so what do we do ?

  • in the trunk
    • set shemaRequired and hostRequired to true by default in jDatatypeUrl
    • do as done in the proposed patch
  • in 1.0.x
    • set shemaRequired and hostRequired to true by default in jDatatypeUrl
    • do as done in the proposed patch
    • do nothing, but then JS and PHP checks are not equivalent

IMHO, we should apply the patch I proposed in both the trunk and 1.0.x ; but we should leave jDatatypeUrl alone for the moment, and for compatibility use outside jForms context.

comment:7 Changed 12 years ago by laurentj

trunk : set shemaRequired and hostRequired to true by default in jDatatypeUrl

1.0.x : just the part of the patch on lib/jelix/utils/jFilter.class.php

comment:8 Changed 12 years ago by Julien

  • Resolution set to fixed
  • Status changed from assigned to closed

done in the trunk and 1.0.x branch. r1177

Note: See TracTickets for help on using tickets.