WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Andrew Biss
    Member
    Posted 1 year ago #

    Hi,

    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().

    Thanks,

    Andrew.

    http://wordpress.org/extend/plugins/crayon-syntax-highlighter/

  2. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

  3. Andrew Biss
    Member
    Posted 1 year ago #

    Works OK in version _1.13.1_beta from github.

  4. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome, committing!

  5. arwo
    Member
    Posted 1 year 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:

    cryon_te_content.php

    line: 16

    code:
    require_once('../../crayon_wp.class.php');
    //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
    Member
    Plugin Author

    Posted 1 year 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

About this Topic

Tags

No tags yet.