Quote:
Originally Posted by Andreas
New Bug: Version 1.2 will cause a fatal PHP error if build_user_subscription() is called more then due to redefined functions.
A few suggestions
PHP Code:
foreach($_POST as $key => $value){ $ds[$key] = $value; } $vbulletin->input->clean_array($ds, array( 'send_pm_global' => TYPE_NOHTML, 'send_em_global' => TYPE_NOHTML, 'pm_from_global' => TYPE_NOHTML, 'send_pm_paidsub' => TYPE_NOHTML, 'pm_title_paidsub' => TYPE_NOHTML, 'pm_message_paidsub' => TYPE_NOHTML, 'send_em_paidsub' => TYPE_NOHTML, 'em_subject_paidsub' => TYPE_NOHTML, 'em_body_paidsub' => TYPE_NOHTML ));
Why not just
PHP Code:
$vbulletin->input->clean_array_gpc('p', array( 'send_pm_global' => TYPE_NOHTML, 'send_em_global' => TYPE_NOHTML, 'pm_from_global' => TYPE_NOHTML, 'send_pm_paidsub' => TYPE_NOHTML, 'pm_title_paidsub' => TYPE_NOHTML, 'pm_message_paidsub' => TYPE_NOHTML, 'send_em_paidsub' => TYPE_NOHTML, 'em_subject_paidsub' => TYPE_NOHTML, 'em_body_paidsub' => TYPE_NOHTML ));
PHP Code:
$db->query_write("UPDATE " . TABLE_PREFIX . "datastore SET data='" . $db->escape_string(slw_serial($ds)) . "' WHERE title='pmnotify'");
You should never UPDATE table datastore directly, as the user might use a datastore cache - and thus your updated data will not be in the cache (until it gets cleared).
Use build_datastore() instead.
PHP Code:
$current_dt = strtotime("now");
The current timestamp is available as constant TIMENOW - seems unnecessary overhead to create it again.
|
Hey man, thanks for the suggestions and information!
Can you please elaborate on the v1.2 bug, I don't quite understand how to prevent what you're saying. Any help here would be appreciated.
Will be remembering this and implementing it in the next update.
Once again, tons of thanks =]