PluginProbe
FeedWordPress / 2017.0913
FeedWordPress v2017.0913
trunk 0.8 0.9 0.91 0.95 0.96 0.97 0.98 0.981 0.99 0.991 0.992 0.993 2008.1030 2008.1101 2008.1105 2008.1214 2009.0612 2009.0613 2009.0618 2009.0707 2009.1111 2009.1112 2010.0127 2010.0528 All 65 releases
← All changes | feeds-page.php +16 -6 2016.12132017.0913 View file →
@@ -193,17 +193,27 @@
193 193 <option value="no"<?php echo (!$automatic_updates)?' selected="selected"':''; ?>>cron job or manual updates</option>
194 194 </select>
195 195 <div id="cron-job-explanation" class="setting-description">
196 196 <p><?php
197 - $path = `which curl`; $opts = '--silent %s';
197 + // Do we have shell_exec() available from here, or is it disabled for security reasons?
198 + // If it's available, use it to execute `which` to try to get a realistic path to curl,
199 + // or to wget. If everything fails or shell_exec() isn't available, then just make
200 + // up something for the sake of example.
201 + $shellExecAvailable = (is_callable('shell_exec') && false === stripos(ini_get('disable_functions'), 'shell_exec'));
202 +
203 + if ($shellExecAvailable) :
204 + $path = `which curl`; $opts = '--silent %s';
205 + endif;
206 +
207 + if ($shellExecAvailable and (is_null($path) or strlen(trim($path))==0)) :
208 + $path = `which wget`; $opts = '-q -O - %s';
209 + endif;
210 +
198 211 if (is_null($path) or strlen(trim($path))==0) :
199 - $path = `which wget`; $opts = '-q -O - %s';
200 - if (is_null($path) or strlen(trim($path))==0) :
201 - $path = '/usr/bin/curl'; $opts = '--silent %s';
202 - endif;
212 + $path = '/usr/bin/curl'; $opts = '--silent %s';
203 213 endif;
214 +
204 215 $path = preg_replace('/\n+$/', '', $path);
205 - $crontab = `crontab -l`;
206 216
207 217 $cmdline = $path . ' ' . sprintf($opts, get_bloginfo('url').'?update_feedwordpress=1');
208 218
209 219 ?>If you want to use a cron job,