The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with ampersand in website title
#1
Hi Cris,

I'm having an issue with the use of a ampersand in the website title.

Consider we've got this new client: Barnes & Noble! Smile

// My little test script, pulled together from various sources in GetSimple
Code:
<?php
// data from form 'website settings'
$_POST['sitename'] = 'Barnes & Noble';

// @function cl (basic.php, line 202)
function cl($data) {
    $data = stripslashes(strip_tags(html_entity_decode($data, ENT_QUOTES)));
    return $data;
}

$SITENAME = cl($_POST['sitename']);

// create new site data file (settings.php, line 98)
$ufile = 'website.xml';
//createBak($ufile, $path, $bakpath);
$xmls = @new SimpleXMLElement('<item></item>');
$xmls->addChild('SITENAME', $SITENAME);
$xmls->asXML($ufile);
?>

// The result is a (suppressed) warning: function addChild() is nagging about the '&' in the data
Code:
Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-addChild]: unterminated entity reference Noble in C:\www\vhosts\localhost\prev15~.php on line 18

// The resulting file 'website.xml'
Code:
<?xml version="1.0"?>
<item><SITENAME>Barnes </SITENAME></item>

Mr. Nobel won't be very pleased with us! :/

Is there a special need for performing such rigorous cleaning of HTML entities? In my humble view, the use of htmlspecialchars() would be sufficient for this type of data.

Code:
// @function cl (basic.php, line 202)
function cl($data) {
    $data = stripslashes(strip_tags(htmlspecialchars($data)));
    return $data;
}


Aside from this little issue, I'm very, Very, VERY pleased with your nice and simple CMS! Smile

- Leo
Reply
#2
Try to change & to &amp; in title
Reply
#3
Thanks Leo - i've found that '&' works once you have GS already setup... but apparently it fails at install??

The rigorous cleanings is mainly done for i18n purposes... I'm open to other methods just as long as they work...

I'm also very happy you are so pleased with GS!!!
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 1 Guest(s)