Escaped Characters

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Escaped Characters

Post by Nullig »

I'm having a problem with the ' and " characters being escaped in the News and Company Directory modules. It's happening in one domain only, and a subdomain of that domain doesn't have the problem. Also, other domains on the same server do not have the problem. Both the domain and subdomain are running the same versions/modules. Magic Quotes are off... Any ideas???

----------------------------------------------

Cms Version: 1.6.6

Installed Modules:

   * CMSMailer: 1.73.14
   * FileManager: 1.0.1
   * MenuManager: 1.6.2
   * ModuleManager: 1.3.1
   * News: 2.10.3
   * nuSOAP: 1.0.1
   * Printing: 1.0.4
   * Search: 1.6.1
   * ThemeManager: 1.1.1
   * TinyMCE: 2.5.5
   * AjaxMadeSimple: 0.1.6
   * Album: 0.9.3
   * Calendar: 0.8.2
   * CGExtensions: 1.17.6
   * FormBuilder: 0.5.12
   * VisitorStats: 0.2.1
   * FormBrowser: 0.2.3
   * SimpleGoogleMap: 1.1
   * FrontEndUsers: 1.6.11
   * CustomContent: 1.5.3
   * TruetypeText: 2.1.1
   * CompanyDirectory: 1.4.1
   * Statistics: 0.9.2
   * LinkMgr: 1.4
   * SignInSheet: 1.0


Config Information:

   * php_memory_limit: 64M
   * process_whole_template: true
   * max_upload_size: 10000000
   * default_upload_permission: 664
   * assume_mod_rewrite: false
   * page_extension:
   * internal_pretty_urls: false
   * use_hierarchy: false


Php Information:

   * phpversion: 5.2.8
   * md5_function: On (True)
   * gd_version: 2
   * tempnam_function: On (True)
   * magic_quotes_runtime: Off (False)
   * memory_limit: 32M
   * max_execution_time: 30
   * safe_mode: Off (False)
   * session_save_path: /tmp (1777)
   * session.use_cookies: On (True)


Server Information:

   * Server Api: cgi
   * Server Db Type: MySQL (mysql)
   * Server Db Version: 5.0.85


----------------------------------------------
Nullig
Last edited by Nullig on Sat Nov 28, 2009 8:12 pm, edited 1 time in total.
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm

Re: Escaped Characters

Post by scooper »

Right - this has been some bug hunt. Sit back, you'll enjoy this.... (or skip to the end if you're impatient).

So. I had the same problem - one particular install of CMSMS was escaping quotes in News. This was on a server with half a dozen other installs all of which were behaving nicely.

The site that was playing up had been around since about 0.9 being steadily upgraded so I thought there might have been an old file or something so I tried uploading all the files again, uninstalling and then re-installing modules, doing diffs  and so on.. but nothing helped.

So I did a fresh install in a subdirectory with a new default database - that was fine.  When I swapped the databases on the fresh install with the original db then the problem came back.

Ok, so it's a probably with something in the database rather than files - so I start swapped individual tables between the two databases....

After trying all the likely suspects I just start plodding through methodically. Eventually I get to the 'cms_userplugins' table.... and suddenly that does it. If I swap in the clean version of userplugins then News doesn't escape quotes and if I swap in my orignal userplugins table then it does.

Ok - well I grab Windiff and go through these tables line by line. They're different character sets but that doesn't seem to make any difference, so on I go..... After a few more lines I get the line that's doing it; its info about a UDT called 'slideslide-rob'... and just adding that line is enough to cause the problem.

We're getting close.

So, back to the clean version - into admin and I try and create a new UDT called 'slideshow-rob' .... but it tells me this isn't a valid name. Ok, so I create a UDT called 'slideshow_rob' which is valid. All good. I then go back and edit that UDT and rename it 'slideshow-rob' .... this time it doesn't throw an error... AND when I go back to News my quotes are now being escaped.

We've got it. Repeatable bug.

1. Create UDT 'valid_name'  - News will not escape quotes.
2. Rename same UDT 'invalid-name' with a hypen instead of underscore and News WILL escape quotes.

Of course I haven't the faintest idea why this is happening - but I'm just really pleased that I finally worked out what the hell was going on. I'll leave it to more knowledgeable devs to explain it.

And now - I really think it must be the weekend. Hope this works for you.

s.
jazzbüro
Forum Members
Forum Members
Posts: 85
Joined: Sat Nov 28, 2009 10:15 pm

Re: Escaped Characters

Post by jazzbüro »

You should declare this as a bug:

renaming a UDT with wrong name should throw error message as well as creating UDT with wrong name

Give it a BUG!!!! in the subject ;=)

I adore your patience!
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Escaped Characters

Post by Nullig »

WAT TO GO scooper!!! Great debugging work there.

I had an old UDT named php-info. I deleted it and voila... everything works as it should.

Nullig
Post Reply

Return to “CMSMS Core”