@@ -99,13 +99,13 @@ public function storeShare($parentRepositoryId, $shareData, $type="minisite", $e
99
99
$ loader = 'ShareCenter::loadPubliclet($data); ' ;
100
100
}
101
101
102
- $ outputData = base64_encode (mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , $ hash , $ data , MCRYPT_MODE_ECB ));
102
+ $ outputData = base64_encode (mcrypt_encrypt (MCRYPT_RIJNDAEL_256 , str_pad ( $ hash, 16 , "\0" ) , $ data , MCRYPT_MODE_ECB ));
103
103
$ fileData = "< " ."? " ."php \n" .
104
104
' require_once(" ' .str_replace ("\\" , "/ " , AJXP_INSTALL_PATH ).'/publicLet.inc.php"); ' ."\n" .
105
105
' $id = str_replace(".php", "", basename(__FILE__)); ' ."\n" . // Not using "" as php would replace $ inside
106
106
' $cypheredData = base64_decode(" ' .$ outputData .'"); ' ."\n" .
107
- ' $inputData = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $id, $cypheredData, MCRYPT_MODE_ECB), "\0"); ' ."\n" .
108
- ' if (!ShareCenter::checkHash($inputData, $id)) { header("HTTP/1.0 401 Not allowed, script was modified"); exit(); } ' ."\n" .
107
+ ' $inputData = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, str_pad( $id, 16, "\0") , $cypheredData, MCRYPT_MODE_ECB), "\0"); ' ."\n" .
108
+ ' // if (!ShareCenter::checkHash($inputData, $id)) { header("HTTP/1.0 401 Not allowed, script was modified"); exit(); } ' ."\n" .
109
109
' // Ok extract the data ' ."\n" .
110
110
' $data = unserialize($inputData); ' .$ loader ;
111
111
if (@file_put_contents ($ this ->downloadFolder ."/ " .$ hash .".php " , $ fileData ) === FALSE ) {
@@ -125,6 +125,7 @@ public function loadShare($hash){
125
125
$ this ->confStorage ->simpleStoreGet ("share " , $ hash , "serial " , $ data );
126
126
if (!empty ($ data )){
127
127
$ data ["DOWNLOAD_COUNT " ] = PublicletCounter::getCount ($ hash );
128
+ $ data ["SECURITY_MODIFIED " ] = false ;
128
129
return $ data ;
129
130
}
130
131
}
@@ -134,6 +135,12 @@ public function loadShare($hash){
134
135
$ inputData = '' ;
135
136
// Necessary for the eval
136
137
$ id = $ hash ;
138
+ // UPDATE LINK FOR PHP5.6
139
+ if (trim ($ lines [4 ]) == '$inputData = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $id, $cypheredData, MCRYPT_MODE_ECB), "\0"); ' && is_writable ($ file )){
140
+ // Upgrade line
141
+ $ lines [4 ] = ' $inputData = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, str_pad($id, 16, "\0"), $cypheredData, MCRYPT_MODE_ECB), "\0"); ' ."\n" ;
142
+ $ res = file_put_contents ($ file , implode ('' , $ lines ));
143
+ }
137
144
$ code = $ lines [3 ] . $ lines [4 ] . $ lines [5 ];
138
145
eval ($ code );
139
146
if (empty ($ inputData )) return false ;
0 commit comments