Functions problem with possible security risk
-
Dear developer,
I recently installed the Sharify plugin and intermittently, I’m getting the following errors (path edited to hide only personal data):
Warning: file_get_contents() [function.file-get-contents]: https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 24
Warning: file_get_contents(https://urls.api.twitter.com/1/urls/count.json?url=https://trainify.my/event/nodejs-ninja-rookie/) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 24
Warning: simplexml_load_file() [function.simplexml-load-file]: https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 16
Warning: simplexml_load_file(https://api.facebook.com/restserver.php?method=links.getStats&urls=https://trainify.my/event/nodejs-ninja-rookie/) [function.simplexml-load-file]: failed to open stream: no suitable wrapper could be found in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 16
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity “https://api.facebook.com/restserver.php?method=links.getStats&urls=https://trainify.my/event/nodejs-ninja-rookie/” in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 16
Warning: file_get_contents() [function.file-get-contents]: https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 48
Warning: file_get_contents(https://www.linkedin.com/countserv/count/share?url=https://trainify.my/event/nodejs-ninja-rookie/&format=json) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/<accountname>/public_html/wp-content/plugins/sharify/admin/sharify_count.php on line 48
What it needed was a requirement of the site to have the allow_url_fopen setting turned on.
This allows remote files to be opened through PHP and create a security risk dependant on what remote file is being opened. A better way to implement this would be to use cURL – https://stackoverflow.com/questions/127534/should-i-allow-allow-url-fopen-in-php
You may want to take note on that ??
- The topic ‘Functions problem with possible security risk’ is closed to new replies.