Crayon Syntax Highlighter
[resolved] AJAX functions fail on XAMPP: Incorrect arguments for 'wp-l (6 posts)

  1. Andrew Biss
    Posted 3 years ago #


    Thanks for the great plugin!

    I've found an issue with the AJAX functions on the Crayon Admin page when updating from Crayon 1.12 to 1.13 and running on XAMPP.

    The sample code display and list of posts give Incorrect arguments for 'wp-load' when using XAMPP. Unix-type environments work OK.

    The cause seems to be the crayon_is_path_url() test added to crayon_die_if_not_php() in global.php.

    On Unix-type systems a relative path to the file within the server's file system is saved in the [wp-load] item in the CrayonSyntaxSettings array.

    On Windows this path is absolute and crayon_is_path_url() returns true as the path contains a scheme (in my case "C" as XAMPP is on my C: drive).

    As a workaround I commented out the call to crayon_is_path_url().




  2. akarmenia
    Plugin Author

    Posted 3 years ago #

  3. Andrew Biss
    Posted 3 years ago #

    Works OK in version _1.13.1_beta from github.

  4. akarmenia
    Plugin Author

    Posted 3 years ago #

    Awesome, committing!

  5. arwo
    Posted 3 years ago #

    If You still a problem with "Incorrect arguments for 'wp-load'", it can be cause by empty ABSPATH.
    You can change code in file:


    line: 16

    //crayon_die_if_not_php($_GET['wp_load'], 'wp-load');
    //require_once ($_GET['wp_load']);
    require_once ( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');

  6. akarmenia
    Plugin Author

    Posted 3 years ago #

    This shouldn't be a problem, as 1.14 beta no longer uses GET variables to pass around the wordpress install directory:

    All AJAX functions are now using the wp_ajax action and admin-ajax.php method defined here: http://codex.wordpress.org/AJAX_in_Plugins. This means Crayon no longer passes around the wp_load path and doesn't use it as a $_GET variable to load AJAX requests. The security vulnerability in 1.13 is no longer present and that code has been removed.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Crayon Syntax Highlighter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.