php-wasm icon indicating copy to clipboard operation
php-wasm copied to clipboard

Code confusing between element and its content

Open uuf6429 opened this issue 1 year ago • 0 comments

The first and only parameter of runPhpScriptTag is element, which is expected and used as exclusively as a DOM element node (element.getAttribute...).

However, the line below calls that function with a string, as far as I know (I think this is a bug): https://github.com/seanmorris/php-wasm/blob/094f4e00fa99b1271af077b6de7d0d38d475ecae/source/PhpWeb.js#L77

Other usages of that function seems to be confusing this as well, for example while the following line correctly passes an element, the previous line declares a code variable (from the element content) and doesn't use it anywhere. https://github.com/seanmorris/php-wasm/blob/818a3607b826f0b8eb029572c56042e0865170c1/source/PhpWeb.js#L90

A similar situation can be seen in other files, such as PhpShell.js and PhpWebDrupal.js.

uuf6429 avatar Oct 16 '23 19:10 uuf6429