Skip to content

Commit

Permalink
* Fixed Cookies #215
Browse files Browse the repository at this point in the history
* Fixed error adding user #214
* Fixed empty form action #205
* Fixed autoload #191
* Added javascript event improvements by tn123 #187
* Fixed install problem on FreeBSD #212

git-svn-id: http://wtorrent-project.googlecode.com/svn/trunk@94 5a4c1571-8183-a91d-cfd1-48c08a65d015
  • Loading branch information
royger committed Oct 16, 2008
1 parent fd270b7 commit a1d32ef
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 451 deletions.
5 changes: 2 additions & 3 deletions wtorrent/lib/cls/Web.cls.php
Expand Up @@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
Original class done by David Marco Martinez
Modified by Roger Pau Monné
Modified by Roger Pau Monné
*/
abstract class Web
{
Expand Down Expand Up @@ -165,7 +165,7 @@ final public function getCls( )
*/
public function getURL()
{
return $_SERVER['REQUEST_URI'];
return $this->_server['REQUEST_URI'];
}
/**
* Is this a AJAX call?
Expand Down Expand Up @@ -321,7 +321,6 @@ protected function addMessage($message)
{
$this->message[] = $message;
}

abstract protected function construct( );
}
?>
268 changes: 134 additions & 134 deletions wtorrent/lib/inc/string.inc.php
Expand Up @@ -51,13 +51,13 @@ function unescape( $var )
{
if (!get_magic_quotes_gpc())
{
return;
return $var;
}
return _unescape_internal($var);
}
function html( $str )
{
$str = str_replace( array( 'ñ', 'Ñ' ), array( '&ntilde;', '&Ntilde;' ), $str );
$str = str_replace( array( 'Ò', '' ), array( '&ntilde;', '&Ntilde;' ), $str );
return preg_replace( '/[^\x00-\x7F]/e', '"&#".ord("$0").";"', $str );

return str_replace( array_keys( getHtmlChars( ) ), getHtmlChars( ), $str );
Expand Down Expand Up @@ -98,137 +98,137 @@ function getHtmlChars( )
'|' => '&#124;',
'}' => '&#125;',
'~' => '&#126;',
'' => '&#128;',
'' => '&#130;',
'Œ' => '&#140;',
'Ž' => '&#142;',
'' => '&#145;',
'' => '&#146;',
'' => '&#147;',
'' => '&#148;',
'' => '&#149;',
'' => '&#150;',
'' => '&#151;',
'˜' => '&#152;',
'' => '&#153;',
'š' => '&#154;',
'' => '&#155;',
'œ' => '&#156;',
'Ÿ' => '&#159;',
'¡' => '&iexcl;',
'¢' => '&cent;',
'£' => '&pound;',
'¤' => '&curren;',
'¥' => '&yen;',
'¦' => '&brvbar;',
'§' => '&sect;',
'¨' => '&uml;',
'©' => '&copy;',
'ª' => '&ordf;',
'«' => '&laquo;',
'¬' => '&not;',
'­' => '&shy;',
'®' => '&reg;',
'¯' => '&macr;',
'°' => '&deg;',
'±' => '&plusmn;',
'²' => '&sup2;',
'³' => '&sup3;',
'´' => '&acute;',
'µ' => '&micro;',
'' => '&para;',
'·' => '&middot;',
'¸' => '&cedil;',
'¹' => '&sup1;',
'º' => '&ordm;',
'»' => '&raquo;',
'¼' => '&frac14;',
'½' => '&frac12;',
'¾' => '&frac34;',
'¿' => '&iquest;',
'À' => '&Agrave;',
'Á' => '&Aacute;',
'Â' => '&Acirc;',
'Ã' => '&Atilde;',
'Ä' => '&Auml;',
'Å' => '&Aring;',
'Æ' => '&AElig;',
'Ç' => '&Ccedil;',
'È' => '&Egrave;',
'É' => '&Eacute;',
'Ê' => '&Ecirc;',
'Ë' => '&Euml;',
'Ì' => '&Igrave;',
'Í' => '&Iacute;',
'Î' => '&Icirc;',
'Ï' => '&Iuml;',
'Ð' => '&ETH;',
'Ñ' => '&Ntilde;',
'Ò' => '&Ograve;',
'Ó' => '&Oacute;',
'Ô' => '&Ocirc;',
'Õ' => '&Otilde;',
'Ö' => '&Ouml;',
'×' => '&times;',
'Ø' => '&Oslash;',
'Ù' => '&Ugrave;',
'Ú' => '&Uacute;',
'Û' => '&Ucirc;',
'Ü' => '&Uuml;',
'Ý' => '&Yacute;',
'Þ' => '&THORN;',
'ß' => '&szlig;',
'à' => '&agrave;',
'á' => '&aacute;',
'â' => '&acirc;',
'ã' => '&atilde;',
'ä' => '&auml;',
'å' => '&aring;',
'æ' => '&aelig;',
'ç' => '&ccedil;',
'è' => '&egrave;',
'é' => '&eacute;',
'ê' => '&ecirc;',
'ë' => '&euml;',
'ì' => '&igrave;',
'í' => '&iacute;',
'î' => '&icirc;',
'ï' => '&iuml;',
'ð' => '&eth;',
'ñ' => '&ntilde;',
'ò' => '&ograve;',
'ó' => '&oacute;',
'ô' => '&ocirc;',
'õ' => '&otilde;',
'ö' => '&ouml;',
'÷' => '&divide;',
'ø' => '&oslash;',
'ù' => '&ugrave;',
'ú' => '&uacute;',
'û' => '&ucirc;',
'ü' => '&uuml;',
'ý' => '&yacute;',
'þ' => '&thorn;',
'ÿ' => '&yuml;',
'Œ' => '&OElig;',
'œ' => '&oelig;',
'Š' => '&Scaron;',
'š' => '&scaron;',
'Ÿ' => '&Yuml;',
'ˆ' => '&circ;',
'˜' => '&tilde;',
'' => '&ndash;',
'' => '&mdash;',
'' => '&lsquo;',
'' => '&rsquo;',
'' => '&sbquo;',
'' => '&ldquo;',
'' => '&rdquo;',
'' => '&bdquo;',
'' => '&dagger;',
'' => '&Dagger;',
'' => '&permil;',
'' => '&lsaquo;',
'' => '&rsaquo;' );
'Ä' => '&#128;',
'Ç' => '&#130;',
'å' => '&#140;',
'é' => '&#142;',
'ë' => '&#145;',
'í' => '&#146;',
'ì' => '&#147;',
'î' => '&#148;',
'ï' => '&#149;',
'ñ' => '&#150;',
'ó' => '&#151;',
'ò' => '&#152;',
'ô' => '&#153;',
'ö' => '&#154;',
'õ' => '&#155;',
'ú' => '&#156;',
'ü' => '&#159;',
'°' => '&iexcl;',
'¢' => '&cent;',
'£' => '&pound;',
'§' => '&curren;',
'' => '&yen;',
'' => '&brvbar;',
'ß' => '&sect;',
'®' => '&uml;',
'©' => '&copy;',
'' => '&ordf;',
'´' => '&laquo;',
'¨' => '&not;',
'' => '&shy;',
'Æ' => '&reg;',
'Ø' => '&macr;',
'' => '&deg;',
'±' => '&plusmn;',
'' => '&sup2;',
'' => '&sup3;',
'¥' => '&acute;',
'µ' => '&micro;',
'' => '&para;',
'' => '&middot;',
'' => '&cedil;',
'π' => '&sup1;',
'' => '&ordm;',
'ª' => '&raquo;',
'º' => '&frac14;',
'Ω' => '&frac12;',
'æ' => '&frac34;',
'ø' => '&iquest;',
'¿' => '&Agrave;',
'¡' => '&Aacute;',
'¬' => '&Acirc;',
'' => '&Atilde;',
'ƒ' => '&Auml;',
'' => '&Aring;',
'' => '&AElig;',
'«' => '&Ccedil;',
'»' => '&Egrave;',
'' => '&Eacute;',
' ' => '&Ecirc;',
'À' => '&Euml;',
'Ã' => '&Igrave;',
'Õ' => '&Iacute;',
'Œ' => '&Icirc;',
'œ' => '&Iuml;',
'' => '&ETH;',
'' => '&Ntilde;',
'' => '&Ograve;',
'' => '&Oacute;',
'' => '&Ocirc;',
'' => '&Otilde;',
'÷' => '&Ouml;',
'' => '&times;',
'ÿ' => '&Oslash;',
'Ÿ' => '&Ugrave;',
'' => '&Uacute;',
'' => '&Ucirc;',
'' => '&Uuml;',
'' => '&Yacute;',
'' => '&THORN;',
'' => '&szlig;',
'' => '&agrave;',
'·' => '&aacute;',
'' => '&acirc;',
'' => '&atilde;',
'' => '&auml;',
'Â' => '&aring;',
'Ê' => '&aelig;',
'Á' => '&ccedil;',
'Ë' => '&egrave;',
'È' => '&eacute;',
'Í' => '&ecirc;',
'Î' => '&euml;',
'Ï' => '&igrave;',
'Ì' => '&iacute;',
'Ó' => '&icirc;',
'Ô' => '&iuml;',
'' => '&eth;',
'Ò' => '&ntilde;',
'Ú' => '&ograve;',
'Û' => '&oacute;',
'Ù' => '&ocirc;',
'ı' => '&otilde;',
'ˆ' => '&ouml;',
'˜' => '&divide;',
'¯' => '&oslash;',
'˘' => '&ugrave;',
'˙' => '&uacute;',
'˚' => '&ucirc;',
'¸' => '&uuml;',
'˝' => '&yacute;',
'˛' => '&thorn;',
'ˇ' => '&yuml;',
'å' => '&OElig;',
'ú' => '&oelig;',
'ä' => '&Scaron;',
'ö' => '&scaron;',
'ü' => '&Yuml;',
'à' => '&circ;',
'ò' => '&tilde;',
'ñ' => '&ndash;',
'ó' => '&mdash;',
'ë' => '&lsquo;',
'í' => '&rsquo;',
'Ç' => '&sbquo;',
'ì' => '&ldquo;',
'î' => '&rdquo;',
'Ñ' => '&bdquo;',
'Ü' => '&dagger;',
'á' => '&Dagger;',
'â' => '&permil;',
'ã' => '&lsaquo;',
'õ' => '&rsaquo;' );
}
?>
7 changes: 3 additions & 4 deletions wtorrent/lib/inc/utils.inc.php
Expand Up @@ -26,11 +26,10 @@ function stringForJavascript($in_string) {
}
function autoload( )
{
//$str = 'if( file_exists( \'../lib/cls/\'.$file ) ) require_once( \'../lib/cls/\'.$file );';
$str = 'if( false );';
foreach( func_get_args( ) as $dir )
$str .= 'elseif( file_exists( \''.$dir.'\'.$file ) ) require_once( \''.$dir.'\'.$file );';

{
$str .= 'if(file_exists(\'' . $dir . '/\' . $file)) require_once(\'' . $dir . '/\' . $file);';
}
$cmd =
'function __autoload( $cls )
{
Expand Down
5 changes: 2 additions & 3 deletions wtorrent/wt/cls/AddT.cls.php
Expand Up @@ -17,7 +17,6 @@
*/
class AddT extends rtorrent
{

public function construct()
{
if(!$this->setClient())
Expand Down Expand Up @@ -144,9 +143,9 @@ private function getCookie($url)
// Getting cookie depends on hostname
$purl = parse_url( $url );
return implode(
'; ',
';',
$this->_db->queryColumnAll(
'SELECT id, value, hostname FROM cookie WHERE userid = ? AND hostname LIKE ?',
'SELECT value FROM cookie WHERE userid = ? AND hostname LIKE ?',
$this->getIdUser(),
"%{$purl['host']}%"
)
Expand Down

0 comments on commit a1d32ef

Please sign in to comment.