_TOGGLE

Donations

Donate with PayPal!
Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
Unbekannt $ 10.00
macavity $ 115.00
RedGerry £ 50.00
Unbekannt $ 10.00
minor $ 20.00

Recommended ISP

The '&' character

3.3 Forum ONLY: If you've run into a problem, such as an error message, blank page, or similar problem, this is where to look. Post any installation or other problems or questions here, and I and other users will try to help.
Neue Antwort erstellenNeue Antwort erstellen Druckbare Version

The '&' character

Posten Verfasst am: Tue Oct 05, 2010 7:50 am

When I submit an article with the '&' character in the title pro_news changes it to &. If I edit it it becomes '&' Within the edit page I can remove the extra bits and it saves & properly. Very odd!



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif
BetaTester
BetaTester
 
Beiträge: 492
Dabei seit: Aug 01, 2007
Wohnort: Chantilly, France

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 8:26 am

I'm not understanding. It should appear as & in edit page and in display, but be stored internally as & so that it doesn't generate XHTML validation errors.

Which submit article (admin or user)? Which field or fields? And which template? Which Pro_News version?



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 8:33 am

The forum stripped some of the characters!

It should have said

When I submit an article with the '&' character in the title pro_news changes it to &. If I edit it it becomes '&' Within the edit page I can remove the extra bits and it saves & properly. Very odd!



This is using admin submit in the title field. Using index3fcs.html. Pro_news 3.3.2.0 at the moment..



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif
BetaTester
BetaTester
 
Beiträge: 492
Dabei seit: Aug 01, 2007
Wohnort: Chantilly, France

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 11:00 am

Try this, please.

In admin_functions.php (around line 2496) find:

PHP:
                'T_TITLE' => '<input type="text" name="title" size="50" value="'.htmlprepare($edit['title']).'" />',


and replace with:

PHP:
                'T_TITLE' => '<input type="text" name="title" size="50" value="'.$edit['title'].'" />',


ie. remove the htmlprepare call.

Similarly, in functions.php (around line 1516) find:

PHP:
                'T_TITLE' => '<input type="text" name="title" size="50" value="'.htmlprepare($edit['title']).'" />',


and replace with:

PHP:
                'T_TITLE' => '<input type="text" name="title" size="50" value="'.$edit['title'].'" />',


ie. remove the htmlprepare call.

If that works - and it seems to here - then this bug has always been in Pro_News! Although it may not have always shown up. It only affects the edit display, so no serious DB harm should have ever occurred from this one, although some double amp;amp;'s may have crept in over time.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 11:11 am

Will do.. I only noticed it when trying the & character for the first time.

Seems to work perfectly. You always worry me when my line numbers are so different from yours - it was lines 2469 and 1490 for me!

Shall I change the topic title here to solved?



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif
BetaTester
BetaTester
 
Beiträge: 492
Dabei seit: Aug 01, 2007
Wohnort: Chantilly, France

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 11:25 am

Please do on the title change.

Reason for numbers being off, and why I said "around" is that I'm working with 3.2.2.1. Which I thought was ready! Sad

BTW, seen this post yet?

Looks as if I'll have to do a new release. It used to be a 10 minute job, plus checking, but now takes hours due to all the "extras" added/moved over time.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 11:26 am

One other time (there may be more?) when the title contains an & and you link to CPGNuCalendar it is adding the amp: to it.



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif
BetaTester
BetaTester
 
Beiträge: 492
Dabei seit: Aug 01, 2007
Wohnort: Chantilly, France

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 1:08 pm

Nope, can't reproduce. Can you give me more specifics please?

I did find a db error when using MySQL 5 in Strict mode though. Simple fix for that one.

NEVER MIND: I see - in the Calendar.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 1:12 pm

Hmmm. That has to be a CPGNuCalendar bug, 'cos the browser is displaying the tooltip correctly. So CPGNC is handling the 2 displays (from the same source) differently.



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 1:43 pm

OK, CPGNC presumes that it will receive just a &. So in admin_functions.php around (before) line 2863 find:

PHP:
        $sql = 'INSERT INTO '.$prefix.'_cpgnucalendar VALUES ("", "'.$postby.'", "'.formatDateTime($clsdttime,'%Y%m%d').'", "'.$clstime.'", "'.formatDateTime(time(),'%Y%m%d').'", "'.formatDateTime(time(),'%H%M%S').'", "'.$cal_durtn.'", "'.$cal_priority.'", "'.$cal_rpt.'", "'.$cal_view.'", "'.$title.'", "'.$cal_content.'", "'.$cal_image.'", "'.$cal_appvd.'", "'.$cal_category.'")';


and change to:

PHP:
        $sql = 'INSERT INTO '.$prefix.'_cpgnucalendar VALUES ("0", "'.$postby.'", "'.formatDateTime($clsdttime,'%Y%m%d').'", "'.$clstime.'", "'.formatDateTime(time(),'%Y%m%d').'", "'.formatDateTime(time(),'%H%M%S').'", "'.$cal_durtn.'", "'.$cal_priority.'", "'.$cal_rpt.'", "'.$cal_view.'", "'.htmlunprepare($title).'", "'.$cal_content.'", "'.$cal_image.'", "'.$cal_appvd.'", "'.$cal_category.'")';



Similarly in functions.php (~ 4536) find:

PHP:
        $sql = 'INSERT INTO '.$prefix.'_cpgnucalendar VALUES ("", "'.$postby.'", "'.formatDateTime($clsdttime,'%G%m%d').'", "'.$clstime.'", "'.formatDateTime(time(),'%G%m%d').'", "'.formatDateTime(time(),'%H%M%S').'", "'.$cal_durtn.'", "'.$cal_priority.'", "'.$cal_rpt.'", "'.$cal_view.'", "'.$title.'", "'.$cal_content.'", "'.$cal_image.'", "'.$cal_appvd.'", "'.$cal_category.'")';


and replace with:

PHP:
        $sql = 'INSERT INTO '.$prefix.'_cpgnucalendar VALUES ("0", "'.$postby.'", "'.formatDateTime($clsdttime,'%G%m%d').'", "'.$clstime.'", "'.formatDateTime(time(),'%G%m%d').'", "'.formatDateTime(time(),'%H%M%S').'", "'.$cal_durtn.'", "'.$cal_priority.'", "'.$cal_rpt.'", "'.$cal_view.'", "'.htmlunprepare($title).'", "'.$cal_content.'", "'.$cal_image.'", "'.$cal_appvd.'", "'.$cal_category.'")';



(The 0 added to the first parameter is to address the MySQL5 Strict issue.)



layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback
Site Admin
Site Admin
 
Beiträge: 1229
Dabei seit: Mar 18, 2006

Re: The '&' character

Posten Verfasst am: Tue Oct 05, 2010 3:52 pm

That seems to work, thank you!



rosbif's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.11/4.1.22/5.2.17/9.3.3.1

rosbif
BetaTester
BetaTester
 
Beiträge: 492
Dabei seit: Aug 01, 2007
Wohnort: Chantilly, France
Link  QR  Share this Druckbare Version  facebook   myspace   twitthis  
Show more ...
Beiträge der letzten Zeit anzeigen:   
Neue Antwort erstellenNeue Antwort erstellen Seite 1 von 1

3.3 Support

Gehe zu:  



Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst keine Dateien anhängen.
Du kannst keine Dateien herunterladen.

Alle Zeitangaben sind in GMT






layingback Non-Human Terms of Use