File tree Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 88
99class profile extends action{
1010 function action (){
11-
11+ if ($ this ->data ['user ' ]['uname ' ] != $ _POST ['uname ' ]){
12+ return false ;
13+ }
1214 $ arr = array (
1315 'profile ' => array (
1416 'fname ' => $ _POST ['fname ' ],
1517 'lname ' => $ _POST ['lname ' ],
16- 'uname ' => $ _POST ['uname ' ],
18+ 'uname ' => $ this -> data [ ' user ' ] ['uname ' ],
1719 'password ' => $ _POST ['password ' ]
1820 )
1921 );
@@ -23,7 +25,7 @@ function action(){
2325 }
2426
2527 $ stmt = $ this ->data ['pdo ' ]->prepare ("SELECT * FROM {$ this ->dbprefix }users where uname =:uname; " );
26- $ stmt ->execute (array ('uname ' => $ _POST ['uname ' ]));
28+ $ stmt ->execute (array ('uname ' => $ this -> data [ ' user ' ] ['uname ' ]));
2729 $ row = $ stmt ->fetch ();
2830 if (empty ($ arr ['profile ' ]['password ' ])){
2931 $ arr ['profile ' ]['password ' ] = $ row ['password ' ];
Original file line number Diff line number Diff line change 77*/
88
99class ajax extends ctrl{
10-
10+
1111 function login (){
1212 if (isAjax ($ this ->data )){
1313 if (isset ($ _POST ['action ' ])){
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ function config(){
5252 "salt " => _rand (32 ),
5353 "key " => _rand (12 ),
5454 "Admin " => "KkEtq2SNzvl02OR " , //_rand(8),
55- "version " => "1.0.6 " ,
55+ "version " => "1.0.7 " ,
5656 "timezone " => date_default_timezone_get (),
5757 );
5858}
Original file line number Diff line number Diff line change @@ -427,3 +427,18 @@ function is_ip4($ip){
427427 }
428428 return true ;
429429}
430+
431+ function rstrip_tags ($ arr ){
432+ if (is_array ($ arr )){
433+ foreach ($ arr as $ k => $ v ){
434+ $ arr [$ k ] = rstrip_tags ($ v );
435+ }
436+ return $ arr ;
437+ }else {
438+ if (is_string ($ arr )){
439+ return htmlspecialchars ($ arr );
440+ }else {
441+ return $ arr ;
442+ }
443+ }
444+ }
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ class ctrl{
103103 var $ model = null ;
104104
105105 function __construct ($ data ){
106+ $ data = rstrip_tags ($ data );
106107 $ this ->load = new view ($ data );
107108 $ this ->load ->appendfile (array ());
108109 $ this ->model = new model ($ data );
You can’t perform that action at this time.
0 commit comments