Support » Plugin: Link Fixer » Still getting errors with ver 2.4

  • Hi Keith!
    Glad to see you back!
    I’m sill getting an error with ver. 2.4:
    Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /home/path/to/site/files/www.example.com/wp-content/plugins/permalink-finder/includes/pf-404.php:621 Stack trace: #0 /home/path/to/site/files/www.example.com/wp-content/plugins/permalink-finder/includes/pf-404.php(428): kpg_find_permalink_post_exact('tetstst', '2', 'Y', 'Y', 'Y') #1 /home/path/to/site/files/www.example.com/wp-content/plugins/permalink-finder/permalink-finder.php(37): kpg_permalink_fixer() #2 /home/path/to/site/files/www.example.com/wp-includes/class-wp-hook.php(286): kpg_permalink_finder('') #3 /home/path/to/site/files/www.example.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #4 /home/path/to/site/files/www.example.com/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/path/to/site/files/www.example.com/wp-includes/template-loader.php(12): do_action('template_redire...') #6 /home/path/to/site/files/www.example.com/wp-blog-header.php(19): require_o in /home/path/to/site/files/www.example.com/wp-content/plugins/permalink-finder/includes/pf-404.php on line 621
    Cheers!
    -Brian Brown

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Keith P. Graham

    (@kpgraham)

    OK, I found it. I will fix it and upload a new version as soon as I can.

    Keith

    Plugin Author Keith P. Graham

    (@kpgraham)

    I uploaded a fix this morning. It is not pretty. I test for the existence of the functions before executing them. PHP version and configuration makes a difference in how the plugin works, I need a good way to account for all of these including future changes. I need to support PHP 4 and some ancient versions of WP as well as the latest greatest.
    I have 5 or 6 plugins that I haven’t updated in many years that use the old sql cleaning techniques. Luckily, everyone using them must be living back in 2008.
    Optimistically I am marking this as resolved.

    You can fix this really quick with replacing mysql_real_escape_string() for esc_sql().

    A simple find and replace in pf-404.php will do the trick.

    Hope this helps.

    Plugin Author Keith P. Graham

    (@kpgraham)

    I was searching PHP.net for the workaround, and forgot about the esc_sql function even though I have used it in other plugins.

    I really need to rewrite the code to use prepared statements. That would make the code more secure and easier to read. I may need to get to it someday.

    It is hard to justify spending the time on this plugin since it mostly works and does not generate income. There is also a clone of my code in the repository by another author that does the same thing.

    Keith

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Still getting errors with ver 2.4’ is closed to new replies.