UseBB Community

The official board for UseBB help and discussion

UseBB Community » 1.0 Discussion » Adding raw content

Adding raw content

Page: 1

Author Post
Member
Registered: Oct 2005
Posts: 9
Location: Edmonton, AB
I've been making a page that displays a variety of (generally) static content. Since most of the content will be provided by not-so-tech-saavy types I wanted to make it easy for them to just drop an HTML fragment in a certain subdirectory, add a single entry to another file and see their content become available.

anyways, the final step,
template->add_raw_content(get_file_contents(<filename>));
works fine except that template->body() seemed to be escaping all the quotes in the fragment (bad [tm]).

Anyways in a quest for a quick solution I just wrapped the rawcontents addition in a call to stripcslashes on line 335 of template.php:

template.php:333
if ( isset($request['raw']) ) {

$this->body .= "\n".stripcslashes($this->raw_contents[$request['num']])."\n";
continue;

}


This appears to resolve the issue. I'm wondering if the quotes escaping is expected behaviour for add_raw_content and I'm doing something nutty here. Otherwise I'd love to see this go into the main codebase (makes my life easier come upgrade time :P )
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
That's a result of magic quotes, which UseBB uses. Better to be safe than sorry so this feature will escape all quotes by default. In this case it is not wanted ofcourse... :)

Fixed in CVS. Slashes can still be kept by passing 'false' as a second argument for $template->add_raw_content().
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog

Page: 1

UseBB Community » 1.0 Discussion » Adding raw content

UseBB Community is powered by UseBB 1 Forum Software