Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Plugin contatti problema con byte order mark (BOM)  (Read 12585 times)

0 Members and 1 Guest are viewing this topic.

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Plugin contatti problema con byte order mark (BOM)
« on: July 23, 2010, 06:02:42 pm »

Quando ricevo un messaggio al posto delle lettere accentate appaiono caratteri strani. Nei file della lingua del plugin ho eliminato alcuni caratteri che si erano creati prima del tag <?php. Il problema persiste. Chiedo se qualcuno di voi ha avuto e risolto questo tipo di problema

Grazie
Simone
Logged

Davide Renda

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #1 on: July 26, 2010, 07:33:51 pm »

Mai usato quel plugin, ma hai controllato anche i settaggi della galleria? UTF-8?

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #2 on: July 26, 2010, 07:48:43 pm »

hai controllato anche i settaggi della galleria? UTF-8?

Encoding Caratteri è impostata su UTF-8
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #3 on: July 30, 2010, 04:08:47 pm »

Stesso problema della mia integrazione di Advanced Guestbook: devi impostare ad UTF-8 anche la codifica caratteri del programma di posta. ;)
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #4 on: July 31, 2010, 03:38:24 pm »

Intendi (nel mio caso) outlook express? è già impostato così. Menù Visualizza--->Codifica---> Unicode UTF-8. Forse potrebbe essere lato server?! ho l'email info@miosito.it
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #5 on: July 31, 2010, 04:29:45 pm »

Hmmm...riesci a incollare qui il messaggio incriminato, comprese le intestazioni (Header)?
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #6 on: July 31, 2010, 04:57:08 pm »

Il messaggio che ricevo è così: l'oggetto sarebbe "questo è un messaggio" il contenuto: "questo è un messaggio. L'altro è gìà stato inviato" (per evidenziare gli errori provocati da accento e apostrofo)

oggetto: Invio email dal sito : questo è un messaggio

Please find below a message submitted by 'Simone' on 31/07/2010 at 16:51

questo è un messaggio. L&#39;altro è già stato inviato


Received: (qmail 9420 invoked from network); 31 Jul 2010 16:51:38 +0200
Received: from plesk-unix.natan.it (217.73.226.130)
  by mxavas.natan.it with (DHE-RSA-AES256-SHA encrypted) SMTP; 31 Jul 2010 16:51:38 +0200
Received: (qmail 2397 invoked by uid 10622); 31 Jul 2010 16:51:34 +0200
Date: 31 Jul 2010 16:51:34 +0200
Message-ID: <20100731145134.2395.qmail@plesk-unix.natan.it>
X-Additional-Header: /var/www/vhosts/maranimage.it/httpdocs
To: info@maranimage.it
Subject: Invio email dal sito : questo è un messaggio
From: pippo2@email.it
Reply-To: pippo2@email.it
X-Mailer: PHP/5.1.6
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #7 on: August 02, 2010, 03:17:30 pm »

Mi sa, allora, che il plugin invia messaggi in formato HTML: prova a visualizzarlo come tale anche nel programma di posta.
Se non cambia nulla, fai l'operazione inversa sulla codifica caratteri: da UTF-8 a Latin1.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #8 on: August 03, 2010, 09:03:44 pm »

Mi sa, allora, che il plugin invia messaggi in formato HTML: prova a visualizzarlo come tale anche nel programma di posta.
Se non cambia nulla, fai l'operazione inversa sulla codifica caratteri: da UTF-8 a Latin1.

con la codifica caratteri non cambia niente. Per il formato html in ricezione, con outlook express, ho l'opzione solo per l'invio html

....mi sembra strano che solo io ho questo problema nel forum inglese nessuno si lamenta ???
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #9 on: August 04, 2010, 11:21:22 am »

La cosa mi incuriosisce...prova a impostare il plugin per inviare la posta all'indirizzo che ti comunicherò via email, e fai una prova in modo che mi mandi un messaggio :)
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #10 on: August 04, 2010, 12:18:38 pm »

Ok, fatto :)
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #11 on: August 04, 2010, 02:39:35 pm »

Ricevuta l'email di prova, e c.v.d. il problema è nella codifica caratteri dell'email, impostata su us-ascii, che il mio Thunderbird non riesce a visualizzare correttamente nemmeno selezionando altre codifiche.
Devi riuscire a cambiarla in utf-8 o iso-8859-1 nel codice sorgente del plugin che la genera (dovrebbe essere nel file codebase.php), se non riesci magari me lo scarico e ci dò un'occhiata.
« Last Edit: August 04, 2010, 02:45:40 pm by Ludo »
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #12 on: August 04, 2010, 03:25:13 pm »

ti posto il codice di codebase.php
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

/*********************************************
  Plugin Coded by Frantz Based on Gizmo MOD
  
  Fixing contact button positioning & Added CAPTCHA confirmation
  by B.Mossavari (Sami)
**********************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');
require (
'plugins/contact/include/init.inc.php');
// Add an install action
$thisplugin->add_action('plugin_install','contact_install');

// Add a configure action
$thisplugin->add_action('plugin_configure','contact_configure');

// User menus , (fixed by Sami)
$thisplugin->add_action('page_start','contact_page_start');




// Install function
// Checks if uid is 'me' and pwd is 'you'; If so, then install the plugin
function contact_install() {

    
// Install
    
if ($_POST['submit']==$lang_plugin_contact['button_install']) {

        return 
true;

    
// Loop again
    
} else {

        return 
1;
    }
}

// Configure function
// Displays the form
function contact_configure() {
    global 
$CONFIG$lang_plugin_contact;
require ('plugins/contact/include/init.inc.php');

echo <<< EOT
<h2>{$lang_plugin_contact['install_click']}</h2>
{$lang_plugin_contact['install_note']}<br />
<br />
<form action="
{$_SERVER['REQUEST_URI']}" method="post">
<input type="submit" value="
{$lang_plugin_contact['button_install']}" name="submit" />
</form>
EOT;
}
// create button template from current sys menu template (added by Sami)
function contact_add_admin_button($href,$title,$target,$link)
{
  global 
$template_sys_menu$template_sys_menu_spacer;

  
$new_template=$template_sys_menu;
  
$button=template_extract_block($new_template,'home');
  
   
$params = array(
      
'{HOME_LNK}' => $target,
      
'{HOME_TITLE}' => $title,
      
'{HOME_TGT}' => $href,
      
'home' => $link,
   );
   
$new_button="<!-- BEGIN $link -->".template_eval($button,$params)."<!-- END $link -->\n";
   
template_extract_block($template_sys_menu,'home',"<!-- BEGIN home -->" $button "<!-- END home -->\n" .$new_button);
}

// Add contact button after home under sys menu (added by Sami)
function contact_page_start()
{
  
  
global $template_sys_menu$template_sys_menu_spacer$template_sys_menu_button$sys_menu_buttons;
    global 
$CONFIG$lang_plugin_contact;

    require (
'plugins/contact/include/init.inc.php');
require_once('plugins/contact/include/captcha.class.php');
  
  
  
contact_add_admin_button('index.php?file=contact/contact',$lang_plugin_contact['menu_link'],$lang_plugin_contact['menu_link'],$lang_plugin_contact['menu_link']);
}

?>

Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #13 on: August 04, 2010, 04:28:21 pm »

Ho scaricato il plugin ed ho capito, è il PHP installato sul tuo server ad essere configurato per mandare mail con codifica us-ascii. In questo modo dovresti risolvere:

APRI
plugins/contact/fcf_parse.php

TROVA
Code: [Select]
$headers = 'From: '.$email_from."\r\n" .
SOSTITUISCI CON
Code: [Select]
$headers = 'Content-type: text/html; charset='.$lang_charset."\r\n" .
'From: '.$email_from."\r\n" .

SALVA E CHIUDI
« Last Edit: August 06, 2010, 04:34:52 pm by Ludo »
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #14 on: August 04, 2010, 11:33:05 pm »

nel messaggio ricevuto il campo da è vuoto. Le lettere accentate sono visualizzate. Invece al posto dell'apostrofo appare: &#39;
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #15 on: August 05, 2010, 10:10:05 am »

Ripostami le intestazioni del messaggio, includendo la riga "Content-type".
Per l'apostrofo, prova a cambiare il content-type da text/plain a text/html
« Last Edit: August 05, 2010, 10:15:57 am by Ludo »
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #16 on: August 05, 2010, 12:00:14 pm »

avevo messo male il codice.
Allora:

nel campo DA appare l'email del mittente. apostro e accenti ancora hanno lo stesso problema

Content-type:  text/html; charset=utf-8
Date:  5 Aug 2010 11:56:01 +0200 [11:56:01 CEST]
From:  email@email.it
Message-ID:  <20100805095601.32160.qmail@plesk-unix.natan.it>
Received:  •(qmail 3886 invoked from network); 5 Aug 2010 11:56:05 +0200
•from plesk-unix.natan.it (217.73.226.130) by mxavas.natan.it with (DHE-RSA-AES256-SHA encrypted) SMTP; 5 Aug 2010 11:56:04 +0200
•(qmail 32162 invoked by uid 10622); 5 Aug 2010 11:56:01 +0200
 
Reply-To:  email@email.it
Subject:  Invio email dal sito : nessuno
To:  info@maranimage.it
X-Additional-Header:  /var/www/vhosts/maranimage.it/httpdocs
X-Mailer:  PHP/5.1.6 
 
Logged

Ludo

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #17 on: August 05, 2010, 03:17:08 pm »

Rimandami un'email di prova come ieri, và :)
Anzi, due: una con Content-Type text/plain, l'altra con text/html.
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #18 on: August 05, 2010, 03:56:39 pm »

ok,fatto! c'è posta per te  :)
Logged

VEGA

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 323
    • maranimage
Re: Plugin contatti problema con byte order mark (BOM)
« Reply #19 on: August 05, 2010, 07:24:02 pm »

Risolto.
Resterebbe il problema (che non riguarda il plugin) nel caso in cui nell'oggetto del messaggio venga inserita una parola con l'apostrofo. Come indicato da LUDO, si può risolvere:

nel file fcf_parse.php, trovare:

$email_subject = $email_subject_pre." ".stripslashes($_POST['Subject']);

sostituirlo con

$email_subject = $email_subject_pre."
".html_entity_decode(stripslashes($_POST['Subject']), ENT_QUOTES,
$lang_charset);


Grazie Ludo ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 18 queries.