Преглед на файлове

Updates for PHP 8.1, add copyright, use dir to include require.php, etc

fusionate преди 2 години
родител
ревизия
35a5c34aee
променени са 12 файла, в които са добавени 254 реда и са изтрити 72 реда
  1. 2 2
      app_config.php
  2. 1 1
      app_defaults.php
  3. 2 0
      app_languages.php
  4. 25 5
      message_edit.php
  5. 25 5
      message_logs.php
  6. 25 5
      message_media.php
  7. 25 5
      message_queue.php
  8. 26 6
      message_send.php
  9. 25 5
      message_update.php
  10. 33 13
      messages.php
  11. 35 15
      messages_contacts.php
  12. 30 10
      messages_thread.php

+ 2 - 2
app_config.php

@@ -6,7 +6,7 @@
 		$apps[$x]['category'] = 'System';
 		$apps[$x]['subcategory'] = 'SMS';
 		$apps[$x]['version'] = '1.17';
-		$apps[$x]['license'] = 'Member';
+		$apps[$x]['license'] = 'Mozilla Public License 1.1';
 		$apps[$x]['url'] = 'http://www.fusionpbx.com';
 		$apps[$x]['description']['en-us'] = 'A browser based SMS and MMS client.';
 
@@ -483,4 +483,4 @@
 		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
 
-?>
+?>

+ 1 - 1
app_defaults.php

@@ -6,4 +6,4 @@ if ($domains_processed == 1) {
 
 }
 
-?>
+?>

+ 2 - 0
app_languages.php

@@ -871,4 +871,6 @@
 		$text['label-send_email']['sv-se'] = 'Send Email';
 		$text['label-send_email']['uk-ua'] = 'Send Email';
 
+// 		foreach ($text as $name => $langs) { echo $name.' - '.sizeof($langs).'<br>'; }
+
 ?>

+ 25 - 5
message_edit.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 
 //check permissions
@@ -363,4 +383,4 @@
 //include the footer
 	require_once "resources/footer.php";
 
-?>
+?>

+ 25 - 5
message_logs.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 	require_once "resources/paging.php";
 
@@ -239,4 +259,4 @@
 //include the footer
 	require_once "resources/footer.php";
 
-?>
+?>

+ 25 - 5
message_media.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 
 //get media uuid
 	$message_media_uuid = $_GET['id'];
@@ -140,4 +160,4 @@
 
 	}
 
-?>
+?>

+ 25 - 5
message_queue.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 	require_once "resources/paging.php";
 
@@ -239,4 +259,4 @@
 //include the footer
 	require_once "resources/footer.php";
 
-?>
+?>

+ 26 - 6
message_send.php

@@ -1,14 +1,34 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
+	require_once "resources/check_auth.php";
 
 //check permissions
-	require_once "resources/check_auth.php";
 	if (!permission_exists('message_add') && !permission_exists('message_edit')) {
 		echo "access denied";
 		exit;
@@ -45,4 +65,4 @@
 //URL to send
 	// https://voip.fusionpbx.com/app/messages/message_send.php?message_from=12083334444&message_to=12083330000&message_text=bbb
 
-?>
+?>

+ 25 - 5
message_update.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	include "resources/classes/cache.php";
 
 //get the last message in the cache
@@ -14,4 +34,4 @@
 		echo $cache->get("messages:user:last_message:".$_GET['id']);
 	}
 
-?>
+?>

+ 33 - 13
messages.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 
 //check permissions
@@ -62,7 +82,7 @@
 		}
 	}
 	unset($sql, $parameters, $rows, $row);
-	$message_from = $destinations[0];
+	$message_from = $destinations[0] ?? null;
 	//view_array($destinations);
 
 //get the message to
@@ -206,7 +226,7 @@
 	echo "\n";
 
 	echo "	td.contact_selected {\n";
-	echo "		border-right: 5px solid ".($_SESSION['theme']['table_row_border_color']['text'] != '' ? $_SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
+	echo "		border-right: 5px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
 	echo "		}\n";
 	echo "\n";
 
@@ -215,7 +235,7 @@
 	echo "		width: 75px;\n";
 	echo "		height: 75px;\n";
 	echo "		margin: 3px 8px 3px 2px;\n";
-	echo "		border: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] != '' ? $_SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
+	echo "		border: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
 	echo "		background-repeat: no-repeat;\n";
 	echo "		background-size: cover;\n";
 	echo "		background-position: center center;\n";
@@ -256,7 +276,7 @@
 	echo "		grid-area: contacts;\n";
 	//echo "		min-width: 120px;\n";
 	//echo "		height: 100%;\n";
-	echo "		background: ".$_SESSION['theme']['form_table_field_background_color']['text'].";\n";
+	echo "		background: ".($_SESSION['theme']['form_table_field_background_color']['text'] ?? '#fff').";\n";
 	echo "	}\n";
 	echo "\n";
 	echo ".messages { grid-area: messages; }\n";
@@ -276,7 +296,7 @@
 	echo "</style>\n";
 
 //cache self (primary contact attachment) image
-	if (is_array($_SESSION['tmp']['messages']['contact_me']) && sizeof($_SESSION['tmp']['messages']['contact_me']) != 0) {
+	if (!empty($_SESSION['tmp']) && is_array($_SESSION['tmp']['messages']['contact_me']) && !empty($_SESSION['tmp']['messages']['contact_me'])) {
 		$attachment_type = strtolower(pathinfo($_SESSION['tmp']['messages']['contact_me']['filename'], PATHINFO_EXTENSION));
 		echo "<img id='src_message-bubble-image-me' style='display: none;' src='data:image/".$attachment_type.";base64,".$_SESSION['tmp']['messages']['contact_me']['image']."'>\n";
 	}
@@ -295,7 +315,7 @@
 		echo "						<tr>\n";
 		echo "							<td class='vncell'>".$text['label-message_from']."</td>\n";
 		echo "							<td class='vtable'>\n";
-		if (is_array($destinations) && sizeof($destinations) != 0) {
+		if (!empty($destinations) && is_array($destinations) && sizeof($destinations) != 0) {
 			echo "							<select class='formfld' name='message_from' id='message_new_from' onchange=\"$('#message_new_to').focus();\">\n";
 			foreach ($destinations as $destination) {
 				echo "							<option value='".$destination."'>".format_phone($destination)."</option>\n";
@@ -376,7 +396,7 @@
 		echo "<input type='hidden' name='message_update' id='message_update' value='".$message_update."'>\n";
 
 		//echo "<div>\n";
-		if (count($destinations) > 1) {
+		if (!empty($destinations) && count($destinations) > 1) {
 			echo "	From <select class='formfld' name='message_from' id='message_from'\">\n";
 			foreach ($destinations as $destination) {
 				echo "		<option value='".$destination."'>".$destination."</option>\n";
@@ -385,10 +405,10 @@
 		}
 		else {
 			//echo "	From \n";
-			echo "	<input type='hidden' class='formfld' name='message_from' id='message_from' value='".urlencode($message_from)."'>\n";
+			echo "	<input type='hidden' class='formfld' name='message_from' id='message_from' value='".urlencode($message_from ?? '')."'>\n";
 		}
 		//echo "	To <div id='div_message_to'>".escape($message_to)."</div>\n";
-		echo "	<input type='hidden' class='formfld' name='message_to' id='message_to' value='".urlencode($message_to)."'>\n";
+		echo "	<input type='hidden' class='formfld' name='message_to' id='message_to' value='".urlencode($message_to ?? '')."'>\n";
 		//echo "</div>\n";
 
 		echo "<textarea class='formfld' id='message_text' name='message_text' style='width: 100%; max-width: 100%; min-height: 55px; border: 1px solid #cbcbcb; resize: vertical; padding: 5px 8px; margin-top: 10px; margin-bottom: 5px;' placeholder=\"".$text['description-enter_response']."\"></textarea>";

+ 35 - 15
messages_contacts.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 
 //check permissions
@@ -32,7 +52,7 @@
 	$group_uuids_in = "'".implode("','", $group_uuids)."'";
 
 //get the list of contacts
-	$sql .= "select *, \n";
+	$sql = "select *, \n";
 	$sql .= "(\n";
 	$sql .= "	(select effective_caller_id_name as name from v_extensions where n.number = extension limit 1)\n";
 	$sql .= "	union\n";
@@ -117,7 +137,7 @@
 
 	$parameters['domain_uuid'] = $domain_uuid;
 	$parameters['user_uuid'] = $_SESSION['user']['user_uuid'];
-	$parameters['number'] = $_SESSION['user']['contact_number'];
+	$parameters['number'] = $_SESSION['user']['contact_number'] ?? null;
 //echo "<pre>\n";
 //echo $sql;
 //echo "</pre>\n";
@@ -205,7 +225,7 @@
 	echo "\n";
 
 	echo "	td.contact_selected {\n";
-	echo "		border-right: 5px solid ".($_SESSION['theme']['table_row_border_color']['text'] != '' ? $_SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
+	echo "		border-right: 5px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
 	echo "		}\n";
 	echo "\n";
 
@@ -214,7 +234,7 @@
 	echo "		width: 75px;\n";
 	echo "		height: 75px;\n";
 	echo "		margin: 3px 8px 3px 2px;\n";
-	echo "		border: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] != '' ? $_SESSION['theme']['table_row_border_color']['text'] : '#c5d1e5').";\n";
+	echo "		border: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
 	echo "		background-repeat: no-repeat;\n";
 	echo "		background-size: cover;\n";
 	echo "		background-position: center center;\n";
@@ -223,10 +243,10 @@
 	echo "\n";
 
 	echo "	.row_style0 {\n";
-	echo "		border-bottom: 1px solid ".$_SESSION['theme']['table_row_border_color']['text'].";\n";
-	echo "		background: ".$_SESSION['theme']['form_table_label_background_color']['text'].";\n";
-	echo "		color: ".$_SESSION['theme']['body_text_color']['text'].";\n";
-	echo "		font-family: ".$_SESSION['theme']['body_text_font']['text'].";\n";
+	echo "		border-bottom: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
+	echo "		background: ".($_SESSION['theme']['form_table_label_background_color']['text'] ?? '#e5e9f0').";\n";
+	echo "		color: ".($_SESSION['theme']['body_text_color']['text'] ?? '#5f5f5f').";\n";
+	echo "		font-family: ".($_SESSION['theme']['body_text_font']['text'] ?? 'arial').";\n";
 	echo "		font-size: 12px;\n";
 	echo "		text-align: left;\n";
 	echo "		padding: 4px 7px;\n";
@@ -234,10 +254,10 @@
 	echo "\n";
 
 	echo "	.row_style1 {\n";
-	echo "		border-bottom: 1px solid ".$_SESSION['theme']['table_row_border_color']['text'].";\n";
+	echo "		border-bottom: 1px solid ".($_SESSION['theme']['table_row_border_color']['text'] ?? '#c5d1e5').";\n";
 	echo "		/*background: #fff;*/\n";
-	echo "		color: ".$_SESSION['theme']['body_text_color']['text'].";\n";
-	echo "		font-family: ".$_SESSION['theme']['body_text_font']['text'].";\n";
+	echo "		color: ".($_SESSION['theme']['body_text_color']['text'] ?? '#5f5f5f').";\n";
+	echo "		font-family: ".($_SESSION['theme']['body_text_font']['text'] ?? 'arial').";\n";
 	echo "		font-size: 12px;\n";
 	echo "		text-align: left;\n";
 	echo "		padding: 4px 7px;\n";

+ 30 - 10
messages_thread.php

@@ -1,11 +1,31 @@
 <?php
+/*
+	FusionPBX
+	Version: MPL 1.1
 
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2023
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
 
 //includes files
-	require_once "resources/require.php";
+	require_once dirname(__DIR__, 2) . "/resources/require.php";
 	require_once "resources/check_auth.php";
 
 //check permissions
@@ -30,7 +50,7 @@
 	}
 
 //get the contact uuid
-	$contact_uuid = (is_uuid($_GET['contact_uuid'])) ? $_GET['contact_uuid'] : null;
+	$contact_uuid = !empty($_GET['contact_uuid']) && is_uuid($_GET['contact_uuid']) ? $_GET['contact_uuid'] : null;
 
 //get the limit
 	if (isset($_SESSION['message']['limit']['numeric']) && is_numeric($_SESSION['message']['limit']['numeric'])) {
@@ -82,7 +102,7 @@
 	}
 	$parameters['user_uuid'] = $_SESSION['user_uuid'];
 	$parameters['domain_uuid'] = $domain_uuid;
-	$parameters['message_number'] = $number;
+	$parameters['message_number'] = $number ?? null;
 	$parameters['message_limit'] = $message_limit;
 	$database = new database;
 	$messages = $database->select($sql, $parameters, 'all');
@@ -132,7 +152,7 @@
 	$sql .= "and (message_from like :message_number or message_to like :message_number) ";
 	$parameters['user_uuid'] = $_SESSION['user_uuid'];
 	$parameters['domain_uuid'] = $domain_uuid;
-	$parameters['message_number'] = $number;
+	$parameters['message_number'] = $number ?? null;
 	$database = new database;
 	$database->execute($sql, $parameters);
 	unset($sql, $parameters);
@@ -233,7 +253,7 @@
 	//message media layer
 	echo "<div id='message_media_layer' style='display: none;'></div>\n";
 
-	if (!$refresh) {
+	if (empty($refresh) || !$refresh) {
 		echo "<div id='thread_messages' style='min-height: 300px; overflow: auto; padding-right: 15px;'>\n";
 	}
 
@@ -323,8 +343,8 @@
 		//	echo "	$('img.message-bubble-image-me').attr('src', $('img#src_message-bubble-image-me').attr('src'));\n";
 		echo "</script>\n";
 
-	if (!$refresh) {
+	if (empty($refresh) || !$refresh) {
 		echo "</div>\n";
 	}
 
-?>
+?>