how to get $_POST['text'] from editor without JREQUEST_ALLOW

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
carsten888
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sat Feb 11, 2006 8:32 am
Location: Tilburg, Holland
Contact:

how to get $_POST['text'] from editor without JREQUEST_ALLOW

Post by carsten888 » Mon Feb 25, 2008 7:25 pm

(also in this new forum the subject line is just way too short)

how to get $_POST['text'] from editor without JJREQUEST_ALLOWRAW and still be able to split it up in 2 strings, before and after the hr

Code: Select all

<hr id="system-readmore" />
so far I got this, but it's not save with the raw-data and it shokes on a ' (singlequote).

Code: Select all

$content= JRequest::getVar('content','','post','string', JREQUEST_ALLOWRAW );				
					
				$length = strlen($content);
				$pos = strpos($content, '<hr id="system-readmore" />');
				if($pos){
					$pos2 = $pos + 27;		
					$introtext = addslashes(substr($content, 0, $pos));
					$fulltext = addslashes(substr($content, $pos2, $length));	
				}else{
					$introtext = $content;
					$fulltext = '';
				}
There must be an easyer way.

Anyone ?

Post Reply