Forum Bug, Editor hangs with single quote in title

I have noticed that when the title of the topic contains a single quote; the editor hangs when leaving a reply; by hang I mean the editor does not close and return the user to the forum topic.  The comment does post.  I have confirmed that it is the single quote in the title because when I removed the single quote from the title (and edited the URL to confirm to the way Dolphin creates the URL to the post) one could then leave a reply to the topic without the editor hanging.  This is a problem because users tend to hit the submit button a few dozen times; you know how users are.

Now, I could not recreate this when I made a test on the demo site.  However, it does happen on my site.  I have updated the forum files to the latest SVN as of today, 9-Feb-2013 and cleared the caches.  It did not change the results.  Removing the single quote did clear the problem.  Perhaps I missed a change in the forum database structure somewhere; could that be the answer; does anyone know?

Geeks, making the world a better place
Quote · 9 Feb 2013

It is possible it caused this problem: http://www.boonex.com/forums/?action=goto&search=1#topic/Autopilot-has-crashed.htm

 

Anyone?

Geeks, making the world a better place
Quote · 9 Feb 2013

i have noticed when dealing with php that single quotes in text fields can be a harrassing nightmare. I typically use dreamweaver for forms because it will add the proper code for the single quotes to be allowed.

So - if you know where to look in the code and have good knowledge of php. I would try adding the code to (i guess) strip the single quotes.

This is what I have from dreamweaver so i hope it helps you or anyone else :

if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;   
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

So - I am guessing that something like this is needed for you as well

caredesign.net
Quote · 10 Feb 2013

Yes.  However, I am talking about the standard forum files and sql; I have done nothing to the files.  I have seen this happen twice now.

Geeks, making the world a better place
Quote · 10 Feb 2013

I wasnt thinking that you changed any of the files. I was just saying that the fields (i think) must be stripped (or whatever it is called) of the single quotes, cause php looks at single quotes as a part of the code and doesnt realize it is what the user typed in the field. I am thinking that the code is not stripping the single quotes thus acting up.

Someone like deanos or AlexT could further answer this better than I.

caredesign.net
Quote · 10 Feb 2013

Actually stripping it is incorrect. A single quote is an apostrophe in most cases. And you don't want to strip it. You want to escape it before it is written to the database.

Anyhow. Dolphin is already suppose to take care of that before it stores it in the database. If it does not, then there is a bug that should be reported.

Look in admin in host tools for the state of your servers php setting for magic_quotes_gpc.

In earlier versions of dolphin this was suppose to be on. But now boonex recommends it be off. You may want as a test to turn it on if its off or off if it's on to see if it has any affect with your current problem.

https://www.deanbassett.com
Quote · 10 Feb 2013

Maybe it's related to this one. http://www.boonex.com/forums/topic/Autopilot-has-crashed.htm

Ticket was created and also has something to do with a apostrophe in the title.

https://www.deanbassett.com
Quote · 10 Feb 2013

thanks deano - i wasnt sure what the term was called. gald you came in with the correct term.

caredesign.net
Quote · 10 Feb 2013

What is puzzling to me is that I have a test site and a production site; both on the same webserver; same PHP; both up to date with the latest SVN.  I tried to create a post with an apostrophe in the title on the test site but it worked without problem when making a reply.  Same with the Dolphin demo site.  The test site and the production site are not exact clones of each other but close as far as modules and such.  I may create a test post on the production site to see if it will happen there; I don't like doing such on a site with real users.

As for the database, the URL was stored without the apostrophe; "UFO's [sic] just might be" was stored as UFO-s-just-might-be and the title was stored as UFO's just might be.

As I said, when I went in and edited the topic, both Title and URL (to be consistent) removing the apostrophe, replies worked as they should, the editor stopped hanging.

This also caused autopilot to hang; it could not create the link and the part 2 topic was not created.

Geeks, making the world a better place
Quote · 10 Feb 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.