eval

PHP eval() is this exploitable in my code? (dynamic arguments)

雨燕双飞 提交于 2019-12-12 03:18:26
问题 EDIT: after reading all the input from the other users, i decided, to use what @chris suggested call_user_func_array() one more reason not to use eval() its slower than call_user_func_array() , but so far, nobody was able to exploit it my way, if you find a way, please post it as answer or comment :). So everybody can learn from it. Merry XMAS to all! ---EDIT END--- Ok i needed to make a dynamic code: I get user input like $_POST['a'], $_POST['b']; // Depends on each query how many user input

Google Closure Compiler - How to create an Extern for a variable (variable name can't change as it is in an Eval)

好久不见. 提交于 2019-12-12 03:17:23
问题 I am using Google Closure Compiler in "SIMPLE_OPTIMIZATIONS" mode. The JavaScript uses an "Eval" statement with the variable "_u" embedded in the string. When Google Closure Compiler obfuscates the code, the variable name is changed to "a" and I get an error that "_u" is not defined in the console. My understanding is that an Extern will solve this problem, but I'm not sure how to write it. Thoughts? Code Snippet: var FuncName = (function(){ var ht=escape(_w.location.href) function _fC(_u){

replacing eval in privately scoped variables

大城市里の小女人 提交于 2019-12-12 02:54:59
问题 I'm trying to remove the eval statement in this function. I'm used to the this[whatever] style replacement but it doesn't work out in this instance. Have a look: var App = (function(fw) { var somevar1 = "hello"; var somevar2 = "world"; this.get = function(what) { return eval(what); } }); var app = new App({some: "thing"}); // now for the use: console.log(app.get("somevar1"),app);​ In the function, all my normal "eval scrubbing" options are not working for instance, I cant use: return this

PHP: run function at certain places (preg_callback?)

二次信任 提交于 2019-12-12 01:39:34
问题 I'm trying to run a function whenever there's a [%xxx%] (acting as a placeholder, if you will), e.g.: Bla bla bla blabla. Blablabla bla bla. [%hooray%] Blabla hey bla bla. [%yay%] blabla bla. I'm pretty much a PHP beginner, but I managed to crack my head through and come up with the following (yay to me - I somehow managed to understand the basics of regular expressions!): $maintext = preg_replace("#\[%(.{1,20})%\]#", "display_products('$1')"), $maintext); echo $maintext; I tried working with

Using a string as an expression to be send to eval() and replacing a sub-string with a vriable value PHP

不羁的心 提交于 2019-12-12 00:30:05
问题 I need some help with basic syntax in PHP, I got the following string : $str = "return (strlen(replace) <= 5 && strlen(replace) >= 1);"; and I got a variable : $var = "VariableValue"; and the st_replace function as : str_replace('replace', $var, $str); What I am trying to do is actually use eval in somehing like: if(eval($str)){//This should now make the if condition **look like** //if(strlen(*'VariableValue'*)...) // echo 'Success'; }else{ echo 'Ask the guys at StackOverFlow :),sure after

Lets solve cross-domain ajax, totally on the client, using script tags

吃可爱长大的小学妹 提交于 2019-12-11 22:55:45
问题 I know, there's JSONP, which involves server cooperation to name-space the data. What is bothering me is the fact that the content of script tag src is evaluated , but it's NOT available to read. <script src="http://www.google.com"></script> All we need to figure out is how to namespace the data, that's all. Of course I tried pretty idiotic things with no relevant result (I know this doesn't work, but you can see what I'm trying to achieve): <script>eval('var namespace="');</script> <script

从说话人识别demo开始学习kaldi--(6)

心已入冬 提交于 2019-12-11 20:38:34
完整步骤在这里: https://github.com/kaldi-asr/kaldi/blob/master/egs/aishell/v1/run.sh 下面是从训练对角矩阵开始的 sid/train_diag_ubm.sh --cmd " $train_cmd " --num-threads 16 data/dev 1024 exp/diag_ubm_1024 现在我们使用dev的数据来训练一个对角ubm 除了必要的参数设置,data/dev文件夹下面一定要有的是feats.scp,vad.scp 最后生成的是一个exp/diag_ubm_1024/final.dubm 下面是过程中出现的: sid/train_diag_ubm.sh --cmd run.pl --num-threads 16 data/dev 1024 exp/diag_ubm_1024 sid/train_diag_ubm.sh: initializing model from E-M in memory, sid/train_diag_ubm.sh: starting from 512 Gaussians, reaching 1024 ; sid/train_diag_ubm.sh: for 20 iterations, using at most 500000 frames of data

How to call code behind function from label.text in asp.net

断了今生、忘了曾经 提交于 2019-12-11 20:32:29
问题 I am trying to call a function defined in code behind from Label.Text but it's not working. Here is the code... code in .aspx file <asp:Label runat="server" Text='<%# GetPagingCaptionString() %>' ID="pagenumberLabel"></asp:Label> code block from code behind public string GetPagingCaptionString() { int currentPageNumber = Convert.ToInt32(txtHidden.Value); int searchOrderIndex; if (int.TryParse(Convert.ToString(Session["searchOrderIndex"]), out searchOrderIndex)) { return string.Format("{0} to

How to use String representation of object property, operator, and value?

こ雲淡風輕ζ 提交于 2019-12-11 19:53:58
问题 I'm trying to use a string value of say, "[ScheduledDate] < '11/1/2011'", and test for a bool value on an object like "item". But I can't seem to be able to figure out a way to do it successfully. I'm not wanting to use the eval function, but if it's the only way, then I guess I will have to. below is an example of the function I'm trying to use. function _filterItem2() { var item = { ScheduledDate: '1/1/2012' }; var filterExpression = "[ScheduledDate] < '11/1/2011'"; var result = item

eval not reading variable inside a internal function

依然范特西╮ 提交于 2019-12-11 19:37:08
问题 When using inner function, it reads variable defined in outer function. But somehow it fails when using eval(). It seems to be related to how locals() works... but I'm not sure how and why... def main(): aaa = 'print this' def somethingelse(): print(locals()) #print(aaa) print(eval('aaa')) print(locals()) somethingelse() main() The above codes wouldn't work, giving error message: File "", line 1, in NameError: name 'aaa' is not defined But if unmark the print(aaa) so both print lines exists,