|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-24 13:12 UTC] jawed@php.net
[2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
Description: ------------ Hello, I'm using addRequiredParameter to customise my OAuth Request Token Action. I Was not able to to get new parameter value from provider class object, there is only this members : [consumer_key] [consumer_secret] => [nonce] => [token] => [token_secret] => [timestamp] => 1311463574 [version] => 1.0a [signature_method] => HMAC-SHA1 [callback] => [request_token_endpoint] => [signature] => My new parameter was checked as required, but not added to provider, so how can I get her value ? I have a dirty hack on provider.c to generate a member from each required parameter on CheckToken , this declare some member twice like 'token' and 'oauth_token'. Index: provider.c =================================================================== --- provider.c (r?vision 313639) +++ provider.c (copie de travail) @@ -155,7 +155,7 @@ return 0; } -static void oauth_provider_check_required_params(HashTable *required_params, HashTable *params, HashTable *missing_params TSRMLS_DC) /* {{{ */ +static void oauth_provider_check_required_params(zval *provider_obj,HashTable *required_params, HashTable *params, HashTable *missing_params TSRMLS_DC) /* {{{ */ { HashPosition hpos, reqhpos, paramhpos; zval **dest_entry, *param; @@ -172,6 +172,8 @@ MAKE_STD_ZVAL(param); ZVAL_STRING(param, key, 1); zend_hash_next_index_insert(missing_params, ¶m, sizeof(zval *), NULL); + }else{ + oauth_provider_set_param_member(provider_obj, key, *dest_entry TSRMLS_CC); } } } while(zend_hash_move_forward_ex(required_params, &hpos)==SUCCESS); @@ -735,7 +737,7 @@ oauth_provider_remove_required_param(sop->required_params, "oauth_token"); } - oauth_provider_check_required_params(sop->required_params, sbs_vars, sop->missing_params TSRMLS_CC); + oauth_provider_check_required_params(pthis,sop->required_params, sbs_vars, sop->missing_params TSRMLS_CC); missing_param_count = zend_hash_num_elements(sop->missing_params); if(missing_param_count) { @@ -859,6 +861,7 @@ sop = fetch_sop_object(pthis TSRMLS_CC); if(oauth_provider_add_required_param(sop->required_params, required_param)==SUCCESS) { + zend_update_property_null(Z_OBJCE_P(pthis), pthis, required_param, req_param_len TSRMLS_CC); RETURN_TRUE; } Reproduce code: --------------- $provider->addRequiredParameter("oauth_newparam"); Expected result: ---------------- $provider->newparam : must exists and contain passed value?