Rare symbols in Fancybox caption Rare symbols in Fancybox caption
 

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

Main Menu

Rare symbols in Fancybox caption

Started by KchoPrro, October 30, 2022, 11:33:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KchoPrro

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!! :)

ron4mac

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:
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);
with:
if ($txtinfo) $obj['opts']['caption'] = htmlentities(bb_decode($txtinfo));
in the plugin's codebase.php file.

KchoPrro

Quote from: ron4mac 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:
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);
with:
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:
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)

ron4mac

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

KchoPrro

Quote from: ron4mac on October 30, 2022, 11:22:21 PM
Didn't know there was the iconv. It may work okay with just the original:
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 ;).