0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

Fixed #3259 -- Fixed problem with prepopulate_from for fields containing

underscores in their name. Patch from Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4537 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-02-17 06:14:23 +00:00
parent f5ede9c5c8
commit 795d832a01

View File

@ -7,7 +7,7 @@ function URLify(s, num_chars) {
"with"];
r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');
s = s.replace(r, '');
s = s.replace(/[^-A-Z0-9\s]/gi, ''); // remove unneeded chars
s = s.replace(/[^-\w\s]/g, ''); // remove unneeded chars
s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens
s = s.toLowerCase(); // convert to lowercase