aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php4
-rw-r--r--include/language.php5
-rw-r--r--include/text.php7
3 files changed, 12 insertions, 4 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 03115effe..794cb25d0 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -488,9 +488,9 @@ function getAttachmentData($body) {
$data["preview"] = html_entity_decode($preview, ENT_QUOTES, 'UTF-8');
}
- $data["description"] = trim($match[3]);
+ $data["description"] = ((isset($match[3])) ? trim($match[3]) : '');
- $data["after"] = trim($match[4]);
+ $data["after"] = ((isset($match[4])) ? trim($match[4]) : '');
return $data;
}
diff --git a/include/language.php b/include/language.php
index d291deb63..23aff0a02 100644
--- a/include/language.php
+++ b/include/language.php
@@ -311,6 +311,11 @@ function string_plural_select_default($n) {
* @return string Language code in 2-letter ISO 639-1 (en, de, fr) format
*/
function detect_language($s) {
+
+ if (!$s) {
+ return EMPTY_STR;
+ }
+
$min_length = get_config('system', 'language_detect_min_length');
if ($min_length === false)
$min_length = LANGUAGE_DETECT_MIN_LENGTH;
diff --git a/include/text.php b/include/text.php
index 29a2ab3b1..f69801302 100644
--- a/include/text.php
+++ b/include/text.php
@@ -108,7 +108,10 @@ function notags($string) {
* @return string
*/
function escape_tags($string) {
- return(htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false));
+ if (!$string) {
+ return EMPTY_STR;
+ }
+ return (htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false));
}
@@ -3531,7 +3534,7 @@ function text_highlight($s, $lang) {
// echo (($xml->asXML('data.xml')) ? 'Your XML file has been generated successfully!' : 'Error generating XML file!');
function arrtoxml($root_elem,$arr) {
- $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><' . $root_elem . '></' . $root_elem . '>', null, false);
+ $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><' . $root_elem . '></' . $root_elem . '>', 0, false);
array2XML($xml,$arr);
return $xml->asXML();