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: Rare symbols in Fancybox caption  (Read 4579 times)

0 Members and 1 Guest are viewing this topic.

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 296
    • 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 "Cigüeñas al Atardecer".

It happens with many words like "Gamón" vs. "Gamón", "Hipocromático" vs. "Hipocromático", "RÃo" vs. "Río", 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: 2026
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: 296
    • 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: 2026
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: 296
    • 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.017 seconds with 19 queries.