WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
javascript gets broken (FIX inside) (1 post)

  1. eikaramba
    Member
    Posted 1 year ago #

    Hello i recently started using https to completely secure our website https://www.fileee.com

    Unfortunately, wordpress HTTPS, when activated rewrites the urls so that javascript stopped working, as parenthesis were removed.

    EXAMPLE:

    My header looks as following:

    [...]
    <script type="text/javascript">
        $LAB.script("//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js")
        .script("https://www.fileee.com/wp-content/themes/fileee/static/js/respond.min.js");
    </script>
    </head>
    [...]

    WordPress HTTPS accidentally replaces "https://www.fileee.com/wp-content/themes/fileee/static/js/respond.min.js") => with => "https://www.fileee.com/wp-content/themes/fileee/static/js/respond.min.js"
    (The round bracket is removed! Resulting in javascript syntax failure!)

    I investigated which regexp caused the failure and found out that the following fix solved the problem:

    //wordpress-https/lib/WordPressHTTPS/Module/parser.php
    ::250
    replace
    @preg_match_all('/(http|https):\/\/[^\'"\)\s]+[\'"\)]+/i', $this->_html, $matches);
    
    with
    @preg_match_all('/(http|https):\/\/[^\'"\)\s]+[^\'"\)]+/i', $this->_html, $matches);

    http://wordpress.org/extend/plugins/wordpress-https/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.