WordPress.org

Make WordPress Core

source: tags/2.2/wp-includes/pluggable.php

Last change on this file was 5440, checked in by ryan, 14 years ago

Escapage

  • Property svn:eol-style set to native
File size: 19.2 KB
Line 
1<?php
2
3        /* These functions can be replaced via plugins.  They are loaded after
4         plugins are loaded. */
5
6if ( !function_exists('set_current_user') ) :
7function set_current_user($id, $name = '') {
8        return wp_set_current_user($id, $name);
9}
10endif;
11
12if ( !function_exists('wp_set_current_user') ) :
13function wp_set_current_user($id, $name = '') {
14        global $current_user;
15
16        if ( isset($current_user) && ($id == $current_user->ID) )
17                return $current_user;
18
19        $current_user = new WP_User($id, $name);
20
21        setup_userdata($current_user->ID);
22
23        do_action('set_current_user');
24
25        return $current_user;
26}
27endif;
28
29if ( !function_exists('wp_get_current_user') ) :
30function wp_get_current_user() {
31        global $current_user;
32
33        get_currentuserinfo();
34
35        return $current_user;
36}
37endif;
38
39if ( !function_exists('get_currentuserinfo') ) :
40function get_currentuserinfo() {
41        global $current_user;
42
43        if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST )
44                return false;
45
46        if ( ! empty($current_user) )
47                return;
48
49        if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||
50                !wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true) ) {
51                wp_set_current_user(0);
52                return false;
53        }
54
55        $user_login = $_COOKIE[USER_COOKIE];
56        wp_set_current_user(0, $user_login);
57}
58endif;
59
60if ( !function_exists('get_userdata') ) :
61function get_userdata( $user_id ) {
62        global $wpdb;
63        $user_id = (int) $user_id;
64        if ( $user_id == 0 )
65                return false;
66
67        $user = wp_cache_get($user_id, 'users');
68
69        if ( $user )
70                return $user;
71
72        if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID = '$user_id' LIMIT 1") )
73                return false;
74
75        $wpdb->hide_errors();
76        $metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'");
77        $wpdb->show_errors();
78
79        if ($metavalues) {
80                foreach ( $metavalues as $meta ) {
81                        $value = maybe_unserialize($meta->meta_value);
82                        $user->{$meta->meta_key} = $value;
83
84                        // We need to set user_level from meta, not row
85                        if ( $wpdb->prefix . 'user_level' == $meta->meta_key )
86                                $user->user_level = $meta->meta_value;
87                } // end foreach
88        } //end if
89
90        // For backwards compat.
91        if ( isset($user->first_name) )
92                $user->user_firstname = $user->first_name;
93        if ( isset($user->last_name) )
94                $user->user_lastname = $user->last_name;
95        if ( isset($user->description) )
96                $user->user_description = $user->description;
97
98        wp_cache_add($user_id, $user, 'users');
99        wp_cache_add($user->user_login, $user_id, 'userlogins');
100        return $user;
101}
102endif;
103
104if ( !function_exists('update_user_cache') ) :
105function update_user_cache() {
106        return true;
107}
108endif;
109
110if ( !function_exists('get_userdatabylogin') ) :
111function get_userdatabylogin($user_login) {
112        global $wpdb;
113        $user_login = sanitize_user( $user_login );
114
115        if ( empty( $user_login ) )
116                return false;
117
118        $user_id = wp_cache_get($user_login, 'userlogins');
119        $userdata = wp_cache_get($user_id, 'users');
120
121        if ( $userdata )
122                return $userdata;
123
124        $user_login = $wpdb->escape($user_login);
125
126        if ( !$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_login = '$user_login'") )
127                return false;
128
129        $wpdb->hide_errors();
130        $metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user->ID'");
131        $wpdb->show_errors();
132
133        if ($metavalues) {
134                foreach ( $metavalues as $meta ) {
135                        $value = maybe_unserialize($meta->meta_value);
136                        $user->{$meta->meta_key} = $value;
137
138                        // We need to set user_level from meta, not row
139                        if ( $wpdb->prefix . 'user_level' == $meta->meta_key )
140                                $user->user_level = $meta->meta_value;
141                }
142        }
143
144        // For backwards compat.
145        if ( isset($user->first_name) )
146                $user->user_firstname = $user->first_name;
147        if ( isset($user->last_name) )
148                $user->user_lastname = $user->last_name;
149        if ( isset($user->description) )
150                $user->user_description = $user->description;
151
152        wp_cache_add($user->ID, $user, 'users');
153        wp_cache_add($user->user_login, $user->ID, 'userlogins');
154        return $user;
155
156}
157endif;
158
159if ( !function_exists('wp_mail') ) :
160function wp_mail($to, $subject, $message, $headers = '') {
161        global $phpmailer;
162
163        if ( !is_object( $phpmailer ) ) {
164                require_once(ABSPATH . WPINC . '/class-phpmailer.php');
165                require_once(ABSPATH . WPINC . '/class-smtp.php');
166                $phpmailer = new PHPMailer();
167        }
168
169        $mail = compact('to', 'subject', 'message', 'headers');
170        $mail = apply_filters('wp_mail', $mail);
171        extract($mail);
172
173        if ( $headers == '' ) {
174                $headers = "MIME-Version: 1.0\n" .
175                        "From: " . apply_filters('wp_mail_from', "wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']))) . "\n" . 
176                        "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
177        }
178
179        $phpmailer->ClearAddresses();
180        $phpmailer->ClearCCs();
181        $phpmailer->ClearBCCs();
182        $phpmailer->ClearReplyTos();
183        $phpmailer->ClearAllRecipients();
184        $phpmailer->ClearCustomHeaders();
185
186        $phpmailer->FromName = "WordPress";
187        $phpmailer->AddAddress("$to", "");
188        $phpmailer->Subject = $subject;
189        $phpmailer->Body    = $message;
190        $phpmailer->IsHTML(false);
191        $phpmailer->IsMail(); // set mailer to use php mail()
192
193        do_action_ref_array('phpmailer_init', array(&$phpmailer));
194
195        $mailheaders = (array) explode( "\n", $headers );
196        foreach ( $mailheaders as $line ) {
197                $header = explode( ":", $line );
198                switch ( trim( $header[0] ) ) {
199                        case "From":
200                                $from = trim( str_replace( '"', '', $header[1] ) );
201                                if ( strpos( $from, '<' ) ) {
202                                        $phpmailer->FromName = str_replace( '"', '', substr( $header[1], 0, strpos( $header[1], '<' ) - 1 ) );
203                                        $from = trim( substr( $from, strpos( $from, '<' ) + 1 ) );
204                                        $from = str_replace( '>', '', $from );
205                                } else {
206                                        $phpmailer->FromName = $from;
207                                }
208                                $phpmailer->From = trim( $from );
209                                break;
210                        default:
211                                if ( $line != '' && $header[0] != 'MIME-Version' && $header[0] != 'Content-Type' )
212                                        $phpmailer->AddCustomHeader( $line );
213                                break;
214                }
215        }
216
217        $result = @$phpmailer->Send();
218
219        return $result;
220}
221endif;
222
223if ( !function_exists('wp_login') ) :
224function wp_login($username, $password, $already_md5 = false) {
225        global $wpdb, $error;
226
227        if ( '' == $username )
228                return false;
229
230        if ( '' == $password ) {
231                $error = __('<strong>ERROR</strong>: The password field is empty.');
232                return false;
233        }
234
235        $login = get_userdatabylogin($username);
236        //$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
237
238        if (!$login) {
239                $error = __('<strong>ERROR</strong>: Invalid username.');
240                return false;
241        } else {
242                // If the password is already_md5, it has been double hashed.
243                // Otherwise, it is plain text.
244                if ( ($already_md5 && md5($login->user_pass) == $password) || ($login->user_login == $username && $login->user_pass == md5($password)) ) {
245                        return true;
246                } else {
247                        $error = __('<strong>ERROR</strong>: Incorrect password.');
248                        $pwd = '';
249                        return false;
250                }
251        }
252}
253endif;
254
255if ( !function_exists('is_user_logged_in') ) :
256function is_user_logged_in() {
257        $user = wp_get_current_user();
258
259        if ( $user->id == 0 )
260                return false;
261
262        return true;
263}
264endif;
265
266if ( !function_exists('auth_redirect') ) :
267function auth_redirect() {
268        // Checks if a user is logged in, if not redirects them to the login page
269        if ( (!empty($_COOKIE[USER_COOKIE]) &&
270                                !wp_login($_COOKIE[USER_COOKIE], $_COOKIE[PASS_COOKIE], true)) ||
271                         (empty($_COOKIE[USER_COOKIE])) ) {
272                nocache_headers();
273
274                wp_redirect(get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']));
275                exit();
276        }
277}
278endif;
279
280if ( !function_exists('check_admin_referer') ) :
281function check_admin_referer($action = -1) {
282        $adminurl = strtolower(get_option('siteurl')).'/wp-admin';
283        $referer = strtolower(wp_get_referer());
284        if ( !wp_verify_nonce($_REQUEST['_wpnonce'], $action) &&
285                !(-1 == $action && strpos($referer, $adminurl) !== false)) {
286                wp_nonce_ays($action);
287                die();
288        }
289        do_action('check_admin_referer', $action);
290}endif;
291
292if ( !function_exists('check_ajax_referer') ) :
293function check_ajax_referer() {
294        $cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
295        foreach ( $cookie as $tasty ) {
296                if ( false !== strpos($tasty, USER_COOKIE) )
297                        $user = substr(strstr($tasty, '='), 1);
298                if ( false !== strpos($tasty, PASS_COOKIE) )
299                        $pass = substr(strstr($tasty, '='), 1);
300        }
301        if ( !wp_login( $user, $pass, true ) )
302                die('-1');
303        do_action('check_ajax_referer');
304}
305endif;
306
307// Cookie safe redirect.  Works around IIS Set-Cookie bug.
308// http://support.microsoft.com/kb/q176113/
309if ( !function_exists('wp_redirect') ) :
310function wp_redirect($location, $status = 302) {
311        global $is_IIS;
312
313        $location = apply_filters('wp_redirect', $location, $status);
314
315        if ( !$location ) // allows the wp_redirect filter to cancel a redirect
316                return false; 
317
318        $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
319        $location = wp_kses_no_null($location);
320
321        $strip = array('%0d', '%0a');
322        $location = str_replace($strip, '', $location);
323
324        if ( $is_IIS ) {
325                header("Refresh: 0;url=$location");
326        } else {
327                if ( php_sapi_name() != 'cgi-fcgi' )
328                        status_header($status); // This causes problems on IIS and some FastCGI setups
329                header("Location: $location");
330        }
331}
332endif;
333
334if ( !function_exists('wp_get_cookie_login') ):
335function wp_get_cookie_login() {
336        if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) )
337                return false;
338
339        return array('login' => $_COOKIE[USER_COOKIE],  'password' => $_COOKIE[PASS_COOKIE]);
340}
341
342endif;
343
344if ( !function_exists('wp_setcookie') ) :
345function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
346        if ( !$already_md5 )
347                $password = md5( md5($password) ); // Double hash the password in the cookie.
348
349        if ( empty($home) )
350                $cookiepath = COOKIEPATH;
351        else
352                $cookiepath = preg_replace('|https?://[^/]+|i', '', $home . '/' );
353
354        if ( empty($siteurl) ) {
355                $sitecookiepath = SITECOOKIEPATH;
356                $cookiehash = COOKIEHASH;
357        } else {
358                $sitecookiepath = preg_replace('|https?://[^/]+|i', '', $siteurl . '/' );
359                $cookiehash = md5($siteurl);
360        }
361
362        if ( $remember )
363                $expire = time() + 31536000;
364        else
365                $expire = 0;
366
367        setcookie(USER_COOKIE, $username, $expire, $cookiepath, COOKIE_DOMAIN);
368        setcookie(PASS_COOKIE, $password, $expire, $cookiepath, COOKIE_DOMAIN);
369
370        if ( $cookiepath != $sitecookiepath ) {
371                setcookie(USER_COOKIE, $username, $expire, $sitecookiepath, COOKIE_DOMAIN);
372                setcookie(PASS_COOKIE, $password, $expire, $sitecookiepath, COOKIE_DOMAIN);
373        }
374}
375endif;
376
377if ( !function_exists('wp_clearcookie') ) :
378function wp_clearcookie() {
379        setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
380        setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);
381        setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
382        setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);
383}
384endif;
385
386if ( ! function_exists('wp_notify_postauthor') ) :
387function wp_notify_postauthor($comment_id, $comment_type='') {
388        global $wpdb;
389
390        $comment = get_comment($comment_id);
391        $post    = get_post($comment->comment_post_ID);
392        $user    = get_userdata( $post->post_author );
393
394        if ('' == $user->user_email) return false; // If there's no email to send the comment to
395
396        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
397
398        $blogname = get_option('blogname');
399
400        if ( empty( $comment_type ) ) $comment_type = 'comment';
401
402        if ('comment' == $comment_type) {
403                $notify_message  = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
404                $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
405                $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
406                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
407                $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
408                $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
409                $notify_message .= __('You can see all comments on this post here: ') . "\r\n";
410                $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
411        } elseif ('trackback' == $comment_type) {
412                $notify_message  = sprintf( __('New trackback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
413                $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
414                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
415                $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
416                $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n";
417                $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
418        } elseif ('pingback' == $comment_type) {
419                $notify_message  = sprintf( __('New pingback on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
420                $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
421                $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
422                $notify_message .= __('Excerpt: ') . "\r\n" . sprintf('[...] %s [...]', $comment->comment_content ) . "\r\n\r\n";
423                $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n";
424                $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
425        }
426        $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
427        $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
428        $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
429
430        $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
431
432        if ( '' == $comment->comment_author ) {
433                $from = "From: \"$blogname\" <$wp_email>";
434                if ( '' != $comment->comment_author_email )
435                        $reply_to = "Reply-To: $comment->comment_author_email";
436        } else {
437                $from = "From: \"$comment->comment_author\" <$wp_email>";
438                if ( '' != $comment->comment_author_email )
439                        $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
440        }
441
442        $message_headers = "MIME-Version: 1.0\n"
443                . "$from\n"
444                . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
445
446        if ( isset($reply_to) )
447                $message_headers .= $reply_to . "\n";
448
449        $notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id);
450        $subject = apply_filters('comment_notification_subject', $subject, $comment_id);
451        $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);
452
453        @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
454   
455        return true;
456}
457endif;
458
459/* wp_notify_moderator
460   notifies the moderator of the blog (usually the admin)
461   about a new comment that waits for approval
462   always returns true
463 */
464if ( !function_exists('wp_notify_moderator') ) :
465function wp_notify_moderator($comment_id) {
466        global $wpdb;
467
468        if( get_option( "moderation_notify" ) == 0 )
469                return true; 
470   
471        $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
472        $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
473
474        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
475        $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
476
477        $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";
478        $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";
479        $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
480        $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
481        $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";
482        $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
483        $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
484        $notify_message .= sprintf( __('Approve it: %s'),  get_option('siteurl')."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";
485        $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";
486        $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";
487        $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";
488        $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";
489
490        $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );
491        $admin_email = get_option('admin_email');
492
493        $notify_message = apply_filters('comment_moderation_text', $notify_message, $comment_id);
494        $subject = apply_filters('comment_moderation_subject', $subject, $comment_id);
495
496        @wp_mail($admin_email, $subject, $notify_message);
497
498        return true;
499}
500endif;
501
502if ( !function_exists('wp_new_user_notification') ) :
503function wp_new_user_notification($user_id, $plaintext_pass = '') {
504        $user = new WP_User($user_id);
505
506        $user_login = stripslashes($user->user_login);
507        $user_email = stripslashes($user->user_email);
508
509        $message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";
510        $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
511        $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
512
513        @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
514
515        if ( empty($plaintext_pass) )
516                return;
517
518        $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
519        $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
520        $message .= get_option('siteurl') . "/wp-login.php\r\n";
521
522        wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
523
524}
525endif;
526
527if ( !function_exists('wp_verify_nonce') ) :
528function wp_verify_nonce($nonce, $action = -1) {
529        $user = wp_get_current_user();
530        $uid = (int) $user->id;
531
532        $i = ceil(time() / 43200);
533
534        //Allow for expanding range, but only do one check if we can
535        if( substr(wp_hash($i . $action . $uid), -12, 10) == $nonce || substr(wp_hash(($i - 1) . $action . $uid), -12, 10) == $nonce )
536                return true;
537        return false;
538}
539endif;
540
541if ( !function_exists('wp_create_nonce') ) :
542function wp_create_nonce($action = -1) {
543        $user = wp_get_current_user();
544        $uid = (int) $user->id;
545
546        $i = ceil(time() / 43200);
547
548        return substr(wp_hash($i . $action . $uid), -12, 10);
549}
550endif;
551
552if ( !function_exists('wp_salt') ) :
553function wp_salt() {
554        $salt = get_option('secret');
555        if ( empty($salt) )
556                $salt = DB_PASSWORD . DB_USER . DB_NAME . DB_HOST . ABSPATH;
557
558        return $salt;
559}
560endif;
561
562if ( !function_exists('wp_hash') ) :
563function wp_hash($data) {
564        $salt = wp_salt();
565
566        if ( function_exists('hash_hmac') ) {
567                return hash_hmac('md5', $data, $salt);
568        } else {
569                return md5($data . $salt);
570        }
571}
572endif;
573
574?>
Note: See TracBrowser for help on using the repository browser.