Changeset 2901
- Timestamp:
- Nov 23, 2008, 12:34:58 AM (16 years ago)
- Location:
- branches/2.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/admin/include/functions.php
r2893 r2901 1949 1949 function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0) 1950 1950 { 1951 // After 3 redirections, return false 1952 if ($step > 3) return false; 1953 1954 // Initialize $dest 1951 1955 is_resource($dest) or $dest = ''; 1952 1956 … … 1956 1960 $ch = @curl_init(); 1957 1961 @curl_setopt($ch, CURLOPT_URL, $src); 1958 @curl_setopt($ch, CURLOPT_HEADER, 0);1962 @curl_setopt($ch, CURLOPT_HEADER, 1); 1959 1963 @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); 1960 is_resource($dest) ? 1961 @curl_setopt($ch, CURLOPT_FILE, $dest): 1962 @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 1964 @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 1963 1965 $content = @curl_exec($ch); 1966 $header_length = @curl_getinfo($ch, CURLINFO_HEADER_SIZE); 1964 1967 @curl_close($ch); 1965 1968 if ($content !== false) 1966 1969 { 1967 is_resource($dest) or $dest = $content; 1970 if (preg_match('/Location:\s+?(.+)/', substr($content, 0, $header_length), $m)) 1971 { 1972 return fetchRemote($m[1], $dest, $user_agent, $step+1); 1973 } 1974 $content = substr($content, $header_length); 1975 is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; 1968 1976 return true; 1969 1977 } … … 1982 1990 1983 1991 // Try fsockopen to read remote file 1984 if ($step > 3)1985 {1986 return false;1987 }1988 1989 1992 $src = parse_url($src); 1990 1993 $host = $src['host']; -
branches/2.0/admin/include/functions_upgrade.php
r2885 r2901 142 142 } 143 143 144 if (version_compare($current_release, '1.5.0', '<')) 144 if (version_compare($current_release, '2.0', '<')) 145 { 146 $username = utf8_decode($username); 147 $password = utf8_decode($password); 148 } 149 150 if (version_compare($current_release, '1.5', '<')) 145 151 { 146 152 $query = ' … … 167 173 } 168 174 169 if ($row['password'] != $conf['pass_convert']($ _POST['password']))175 if ($row['password'] != $conf['pass_convert']($password)) 170 176 { 171 177 array_push($page['errors'], l10n('invalid_pwd')); -
branches/2.0/include/functions_session.inc.php
r2885 r2901 132 132 { 133 133 $query = ' 134 UPDATE '.SESSIONS_TABLE.' 135 SET expiration = now(), 136 data = \''.$data.'\' 137 WHERE id = \''.get_remote_addr_session_hash().$session_id.'\' 138 ;'; 139 pwg_query($query); 140 if ( mysql_affected_rows()>0 ) 141 { 142 return true; 143 } 144 $query = ' 145 INSERT INTO '.SESSIONS_TABLE.' 134 REPLACE INTO '.SESSIONS_TABLE.' 146 135 (id,data,expiration) 147 136 VALUES(\''.get_remote_addr_session_hash().$session_id.'\',\''.$data.'\',now())
Note: See TracChangeset
for help on using the changeset viewer.