Projects ⇒ Bugs ⇒ #461: Custom Fields in Profile don't display double (") or single quote (') properly ⇒ CPG Dragonfly™ CMS
Bug #461 Custom Fields in Profile don't display double (") or single quote (') properly
Project: Dragonfly 9.0.3 -> 9.3 Category: My Account
Submitted: Monday, April 18, 2005 (18:03:43) Modified: Tuesday, July 04, 2006 (10:52:55)
Status: Closed Assigned to:
PHP Version: 4.3.10 HTTPD Server: Apache 2.0
Votes: 1
Vote results:
Avg. Score: 3.0 ± 0.0 Reproduced: 1 of 1 (100.0%)
Same PHP Version: 1 (100.0%) Same HTTPD Server: 0 (0.0%)

View/Vote Add Comment

by: insaner
Description:
------------
Custom created text fields in the user profile do not display quotes properly. All quotes are displayed in the user profile with a proceeding \.

Reproduce code:
---------------
N/A

Expected result:
----------------
The quote should display without the \

Actual result:
--------------
For example:

A foot is exactly 12"
will display as
A foot is exactly 12\"
by: Trevor
Not enough information was provided for us to be able to handle this bug.
Please re-read the instructions at How to Report a Bug

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in CPG-Nuke 9.0.3 -> 9.1.

Is the actual custom field (name, not the content of that field) adding a backslash, or is it the user's input for that field?
by: insaner
It is the actual custom field content that the user imputs. I have not tested if the same thing occurs if you put a quote in the name of the custom field. I would link to an example; however, our server is currently down.

Please let me know if you need any more information.
by: Phoenix
Thank you for taking the time to report a problem with CPG-Nuke 9.0.3 -> 9.1.
Unfortunately you are not using a current version of CPG-Nuke 9.0.3 -> 9.1 --
the problem might already be fixed. Please download a new version of CPG-Nuke 9.0.3 -> 9.1 from the
Downloads section.

If you are able to reproduce the bug with one of the latest
versions of CPG-Nuke 9.0.3 -> 9.1, please change the CPG-Nuke 9.0.3 -> 9.1 version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of CPG-Nuke 9.0.3 -> 9.1.

Tested and cannot duplicate the issue.
by: insaner
I still get it. A new user created an account yesterday. When he entered a comment, it should have read like this:

'97 Jeep Wrangler Sahara

but instead reads like this:

\'97 Jeep Wrangler Sahara

I've re-opened the ticket.
by: insaner
BTW... I'm using the latest stable version 9.0.5.0
by: Biggles
This is verified in version 9.0.6.1 too. The problem is in the check_fields() function in modules/Your_Account/functions.php. This function is applying Fix_Quotes() around the data when it is displaying on the website. The code for this function should be:

function check_fields(&$fieldlist, &$valuelist, &$fields) {
global $db, $user_prefix;
$content = '';
$result = $db->sql_uquery("SELECT * FROM ".$user_prefix."_users_fields WHERE visible > 0", false,__FILE__,__LINE__);
while ($row = $db->sql_fetchrow($result)) {
$var = ($row['field'] == 'name')?'realname':$row['field'];
$info = $row['langdef'];
if ($info[0] == '_' && defined($info)) {
$info = constant($info);
}
if (empty($_POST[$var]) && $row['visible'] == 2) {
cpg_error('Required field "'.$info.'" can\'t be empty');
} else {
$val = $_POST[$var];
if (strlen($val) > 0) {
if ($row['type'] == 1 || $row['type'] == 4) {
$val = intval($val);
} elseif ($row['type'] != 3) {
$val = substr($val, 0, $row['size']);
}
$fieldlist .= ", ".$row['field'];
$valuelist .= ", '" . Fix_Quotes( $val, 1 ) . "'";
$fields[$var] = htmlprepare($val);
if ($row['type'] == 1) {
$val = $val ? _YES : _NO;
}
$content .= '<tr><td><b>' . $info . ':</b></td><td>' . htmlprepare($val) . "</td></tr>\n";
if ($row['field'] == 'user_timezone') {
$fields['user_dst'] = intval($_POST['user_dst']);
$fieldlist .= ', user_dst';
$valuelist .= ', '.$fields['user_dst'];
}
}
}
}
return $content;
}
by: insaner
Excellent. Thanks Biggles! I hope that this gets put into the next version :)
by: NanoCaiordo
Please try using one of these CVS snapshots:

Latest tar.gz
Latest tar.bz2

Tested and cannot duplicate the issue.
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español