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

Input IDs on AJAX #9955

Closed
hypeJunction opened this Issue Jul 8, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@hypeJunction
Contributor

hypeJunction commented Jul 8, 2016

I had recently ran into an issue with overlapping input IDs on AJAX requests. The particular issue was with a datepicker that bootstraps using input ID, but I imagine an issue could occur with a longtext as well. We probably need to persist ID iterator across the session.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jul 8, 2016

Member

microtime() . $static_counter?

Member

mrclay commented Jul 8, 2016

microtime() . $static_counter?

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jul 8, 2016

Member

Which views have these generated IDs?

Member

mrclay commented Jul 8, 2016

Which views have these generated IDs?

@hypeJunction

This comment has been minimized.

Show comment
Hide comment
@hypeJunction

hypeJunction Jul 8, 2016

Contributor

elgg_view_input() autogenerates them if they are missing.

Contributor

hypeJunction commented Jul 8, 2016

elgg_view_input() autogenerates them if they are missing.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Jul 8, 2016

Member

base_convert(mt_rand(), 10, 36) should be a fine suffix. It should be uniquely seeded per request.

Member

mrclay commented Jul 8, 2016

base_convert(mt_rand(), 10, 36) should be a fine suffix. It should be uniquely seeded per request.

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Jul 8, 2016

fix(views): issue unique IDs in elgg_view_input()
IDs should be sufficiently (not cryptographically) unique even across multiple
requests.

Fixes #9955

@mrclay mrclay closed this in f20f060 Jul 13, 2016

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