Fatal error: Cannot redeclare quoted_printable_encode() in vcard.class.php

Started by Dipak Bhoi, October 12, 2014, 06:56:22 PM

Previous topic - Next topic

Dipak Bhoi

Hello Guys,

After browsing your joomla site you are receiving an error as below.

QuoteFatal error: Cannot redeclare quoted_printable_encode() in /home/username/public_html/site/includes/vcard.class.php on line 74

Don't worry, i have a solution for you. 

In vcard.class.php around line 36 is the function quoted_printable_encode. This ends up declaring twice, causing the error, so you can prevent the error and fix the error by checking if the function already exists, and if it does, PHP ignores the function declaration. Adding the glow lines of code before and after the existing function clears the problem.

if(!function_exists('quoted_printable_encode')) {
function quoted_printable_encode($input, $line_max=76) {
/* ... */
}
}

Now refresh your page, website should be run smoothly.  That's all.

Enjoy !!
MilesWeb - 30-Day Money Back
cPanel Web Hosting - cPanel Hosting in India
Grab a Free SSL for your website.  WordPress Optimized Solution.