Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add plugin – Stops at step 5 "Verifying README.md and package.yml" #10

Open
tbleckert opened this issue Jun 20, 2013 · 2 comments

Comments

@tbleckert
Copy link

There seems to be something wrong with step 5, it says "Verifying README.md and package.yml" and in the console "POST http://mootools.net/forge/add-5 500 (Internal Server Error)" and that page itself says "The forge is a still a little dusty. Working on it! Thanks for your patience".

@AndiDittrich
Copy link

Same problem here - @arian @timwienk any ideas what's going wrong ? maybe you could take look into the php error.log ?

@AndiDittrich
Copy link

I've setup a copy of MooTools-Forge to track the error...on Step5 the forge will thrown the following error:

FastCGI-stderr: PHP Fatal error: Call to a member function xpath() on a non-object in /www/vhosts/forge/mootools-forge/lib/ForgeMDParser.class.php on line 92

This is caused by the fact, that the rendered Markdown-Document will be converted into XML using simplexml_load_string which is an very bad idea, because this function requires valid XML ! But the used Markdown-Parser "sfMarkdown" is still buggy/outdated and will produce invalid xhtml (script tags dont get escaped, ...).

Attach the code which will cause the error - /lib/ForgeMDParser.class.php

public function parse(){
        $html = sfMarkdown::doConvert($this->data);

        if(!$html) return;

        $html = str_replace(
            array('</pre></code>', '<code>', '</code>', '<br>'), // In any case, only <pre> remains
            array('</pre>', '', '', '<br />'),
            preg_replace('/<pre><code>#(ruby|asp|js|php|x?html|css)/ie', 'strtolower("<pre class=\"$1\">")', $html)
        );

        $this->xml = simplexml_load_string('<div>'.$html.'</div>');
...

as a workaround, you can remove embedded code/script tags and simplify your markdown document/README.md..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants