Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Rare symbols in Fancybox caption  (Read 437 times)

0 Members and 1 Guest are viewing this topic.

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 281
    • Adolfo Ventas - Naturaleza Andaluza
Rare symbols in Fancybox caption
« on: October 30, 2022, 11:33:27 am »

It's funny, I've been using this plugin for a long time and I think it was recently that some words were not encoded correctly (I don't know why).

In the screenshot example, the caption shows "Cigüeñas al Atardecer" and it should read "Cigeas al Atardecer".

It happens with many words like "Gamón" vs. "Gamn", "Hipocromático" vs. "Hipocromtico", "Ro" vs. "Ro", etc.

Not long ago I installed the plugins Final_Extract (final_extract): v2.7 and Problem Solving CAPTCHA (problem_solving_captcha): v1.2. but I just disabled them and the problem persists. There aren't many images, maybe that's why I hadn't noticed before. Any solution?

Thank you!! :)
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1928
Re: Rare symbols in Fancybox caption
« Reply #1 on: October 30, 2022, 03:20:57 pm »

I don't see that behavior on my test site. But you had all the character encoding issues with your database transfer.
I wouldn't normally think is should be necessary, but you could try replacing line 39:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);with:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = htmlentities(bb_decode($txtinfo));in the plugin's codebase.php file.
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 281
    • Adolfo Ventas - Naturaleza Andaluza
Re: Rare symbols in Fancybox caption
« Reply #2 on: October 30, 2022, 07:24:24 pm »

I don't see that behavior on my test site. But you had all the character encoding issues with your database transfer.
I wouldn't normally think is should be necessary, but you could try replacing line 39:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);with:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = htmlentities(bb_decode($txtinfo));in the plugin's codebase.php file.

Solved!, you are a genius! :)

In my codebase.php, the code I had in that line was this:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode(iconv('ISO-8859-1', 'UTF-8', $txtinfo));
Had we solved it before? It seems strange that it has a different encoding than the original file (and I don't usually touch php things myself)
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1928
Re: Rare symbols in Fancybox caption
« Reply #3 on: October 30, 2022, 11:22:21 pm »

Didn't know there was the iconv. It may work okay with just the original:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 281
    • Adolfo Ventas - Naturaleza Andaluza
Re: Rare symbols in Fancybox caption
« Reply #4 on: October 31, 2022, 07:28:25 am »

Didn't know there was the iconv. It may work okay with just the original:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);

That's right, with the original code it works too  8).

But it's strange, I haven't touched the code (I wouldn't know how to touch it), that's why I have the feeling that we had already talked about this little problem and that's why it was changed. I don't understand anything  ???

Thank you very much ron4mac ;).
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.