Commit e9985c21 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#55640, change string comparion on $_GET[q] to arg(), patch by Robert Douglass.

parent 0fad496c
......@@ -493,7 +493,7 @@ function profile_load_profile(&$user) {
}
function profile_save_profile(&$edit, &$user, $category) {
if ($_GET['q'] == 'user/register' || $_GET['q'] == 'admin/user/create') {
if ((arg(0) == 'user' && arg(1) == 'register') || (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create')) {
$result = db_query('SELECT fid, name, type FROM {profile_fields} WHERE register = 1 AND visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
}
else {
......@@ -594,10 +594,10 @@ function _profile_form_explanation($field) {
}
function profile_form_profile($edit, $user, $category) {
if ($_GET['q'] == 'user/register') {
if (arg(0) == 'user' && arg(1) == 'register') {
$result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d AND register = 1 ORDER BY category, weight', PROFILE_HIDDEN);
}
elseif ($_GET['q'] == 'admin/user/create') {
elseif (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create') {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
elseif (user_access('administer users')) {
......@@ -690,10 +690,10 @@ function _profile_update_user_fields($fields, $account) {
}
function profile_validate_profile($edit, $category) {
if ($_GET['q'] == 'user/register') {
if (arg(0) == 'user' && arg(1) == 'register') {
$result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d AND register = 1 ORDER BY category, weight', PROFILE_HIDDEN);
}
elseif ($_GET['q'] == 'admin/user/create') {
elseif (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create') {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
elseif (user_access('administer users')) {
......
......@@ -493,7 +493,7 @@ function profile_load_profile(&$user) {
}
function profile_save_profile(&$edit, &$user, $category) {
if ($_GET['q'] == 'user/register' || $_GET['q'] == 'admin/user/create') {
if ((arg(0) == 'user' && arg(1) == 'register') || (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create')) {
$result = db_query('SELECT fid, name, type FROM {profile_fields} WHERE register = 1 AND visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
}
else {
......@@ -594,10 +594,10 @@ function _profile_form_explanation($field) {
}
function profile_form_profile($edit, $user, $category) {
if ($_GET['q'] == 'user/register') {
if (arg(0) == 'user' && arg(1) == 'register') {
$result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d AND register = 1 ORDER BY category, weight', PROFILE_HIDDEN);
}
elseif ($_GET['q'] == 'admin/user/create') {
elseif (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create') {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
elseif (user_access('administer users')) {
......@@ -690,10 +690,10 @@ function _profile_update_user_fields($fields, $account) {
}
function profile_validate_profile($edit, $category) {
if ($_GET['q'] == 'user/register') {
if (arg(0) == 'user' && arg(1) == 'register') {
$result = db_query('SELECT * FROM {profile_fields} WHERE visibility != %d AND register = 1 ORDER BY category, weight', PROFILE_HIDDEN);
}
elseif ($_GET['q'] == 'admin/user/create') {
elseif (arg(0) == 'admin' && arg(1) == 'user' && arg(2) == 'create') {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
elseif (user_access('administer users')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment