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

This fixes #4763 where adding space created duplicate viewlevels #4776

Merged
merged 2 commits into from Oct 20, 2014
Merged

This fixes #4763 where adding space created duplicate viewlevels #4776

merged 2 commits into from Oct 20, 2014

Conversation

aDaneInSpain
Copy link
Contributor

.#### Steps to reproduce the issue

  1. Go to Users->Access levels.
  2. Click on add button to create new record.
  3. Enter space as chacter and existing level name.
  4. Save the record.

Expected result

Duplicate access levels should not be added.

Actual result

Duplicate access levels are added successfully.screen shot 2014-10-17 at 06 33 26

System information (as much as possible)

PHP Built On Windows NT 6.2 build 9200
Database Version 5.6.12-log
Database Collation utf8_general_ci
PHP Version 5.4.12
Web Server Apache/2.4.4 (Win64) PHP/5.4.12
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.3.7-dev Development [ Ember ] 01-October-2014 02:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0

Additional comments

@hanshenrikchr
Copy link

i just tested this and it works indeed with your patch

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4776.

@jissues-bot jissues-bot changed the title This fixes #4763 where adding space created duplicates This fixes #4763 where adding space created duplicate users Oct 17, 2014
@gunjanpatel
Copy link
Contributor

We have more than 2 successful test, moving to RTC .

@infograf768
Copy link
Member

FILE: ...d/joomla/joomla-cms/administrator/components/com_users/models/level.php


FOUND 1 ERROR(S) AFFECTING 1 LINE(S)


216 | ERROR | Whitespace found at end of line

@infograf768
Copy link
Member

Also, I suggest to use, instead of trim() the new filter which takes also care of multibytes spaces (Asian space), i.e
instead of

+       
+       $data['title'] = trim($data['title']);

use

+       
+       $data['title'] = JFilterInput::getInstance()->clean($data['title'], 'TRIM');

To test here is a multibyte space between both multi
multi multi

@jissues-bot jissues-bot added the RTC This Pull Request is Ready To Commit label Oct 19, 2014
@infograf768 infograf768 added this to the Joomla! 3.3.7 milestone Oct 20, 2014
infograf768 added a commit that referenced this pull request Oct 20, 2014
This fixes #4763 where adding space created duplicate users
@infograf768 infograf768 merged commit fb96409 into joomla:staging Oct 20, 2014
@infograf768
Copy link
Member

Thanks!

@aDaneInSpain aDaneInSpain deleted the patch-1 branch October 20, 2014 07:57
@zero-24
Copy link
Contributor

zero-24 commented Oct 20, 2014

@aDaneInSpain @infograf768 Do you think we should backport it to 2.5.x?

@infograf768
Copy link
Member

The new filtering method does not exist in 2.5.x, so we should use trim().
Also see:
#4858

@infograf768 infograf768 changed the title This fixes #4763 where adding space created duplicate users This fixes #4763 where adding space created duplicate viewlevels Oct 20, 2014
@mbabker mbabker modified the milestones: Joomla! 3.3.7, Joomla! 3.4.0 Nov 22, 2014
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
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.

None yet

7 participants