Browse Source

! Fixed signature preview without javascript

emanuele 12 years ago
parent
commit
efb114368e
3 changed files with 4 additions and 4 deletions
  1. 1 1
      Sources/Profile-Modify.php
  2. 2 2
      Sources/Profile.php
  3. 1 1
      Themes/default/Profile.template.php

+ 1 - 1
Sources/Profile-Modify.php

@@ -799,7 +799,7 @@ function saveProfileFields()
 	// Cycle through the profile fields working out what to do!
 	foreach ($profile_fields as $key => $field)
 	{
-		if (!isset($_POST[$key]) || !empty($field['is_dummy']) || (isset($_POST['preview']) && $key == 'signature'))
+		if (!isset($_POST[$key]) || !empty($field['is_dummy']) || (isset($_POST['preview_signature']) && $key == 'signature'))
 			continue;
 
 		// What gets updated?

+ 2 - 2
Sources/Profile.php

@@ -394,7 +394,7 @@ function ModifyProfile($post_errors = array())
 
 	// Before we go any further, let's work on the area we've said is valid. Note this is done here just in case we ever compromise the menu function in error!
 	$context['completed_save'] = false;
-	$context['do_preview'] = isset($_REQUEST['preview']);
+	$context['do_preview'] = isset($_REQUEST['preview_signature']);
 
 	$security_checks = array();
 	$found_area = false;
@@ -411,7 +411,7 @@ function ModifyProfile($post_errors = array())
 					fatal_lang_error('no_access', false);
 
 				// Are we saving data in a valid area?
-				if (isset($area['sc']) && isset($_REQUEST['save']))
+				if (isset($area['sc']) && (isset($_REQUEST['save']) || $context['do_preview']))
 				{
 					$security_checks['session'] = $area['sc'];
 					$context['completed_save'] = true;

+ 1 - 1
Themes/default/Profile.template.php

@@ -2689,7 +2689,7 @@ function template_profile_signature_modify()
 
 	if (!empty($context['show_preview_button']))
 		echo '
-						<input type="submit" name="preview" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit" />';
+						<input type="submit" name="preview_signature" id="preview_button" value="', $txt['preview_signature'], '" class="button_submit" />';
 
 	if ($context['signature_warning'])
 		echo '