01538: RecipeCheck to handle fopen gracefully

Summary: RecipeCheck to handle fopen gracefully
Created: 2026-01-05 06:28
Status: Closed
Category: Feature
From: simon
Assigned:
Priority: 1
Version: 2.5.2
OS:

Description: Cookbook:RecipeCheck can fail, when the php.ini directive allow_url_fopen isset to 0, with

 [08-Dec-2025 08:26:43 UTC] PHP Warning:  fopen(): https:// wrapper is
disabled in the server configuration by allow_url_fopen=0 in
/home/example/public_html/pmwiki/scripts/diag.php on line 140
...

Could PmWiki please handle this more gracefully

simon

I added this for 2.5.5 but just realized, the function was probably written this way to allow admins to download the recipelist file from pmwiki.org and place it on their server say under pmwiki/local, then do this:

$RecipeListUrl = 'local/recipelist.txt';

I'll be reverting the 2.5.5 changes and adding the cURL functions. Petko

Fixed in 2.5.6 with:

  • a new variable $UrlGetFunction allowing configuration of a custom function to retrieve remote content. Currently the features RecipeCheck and Blocklist use this function, by default it is file_get_contents()
  • and an extension that provides "cURL" for when allow_url_fopen is disabled
  • UrlGet   A PmWiki extension to replace PmWiki's use of "file_get_contents" with "cURL"