Skip to content

Commit

Permalink
UPdated Yii to Version 1.1.24-dev to get rid of a transaction bug
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Apr 28, 2021
1 parent a9df4ac commit 5cdf20f
Show file tree
Hide file tree
Showing 35 changed files with 2,886 additions and 2,084 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/themeoptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function updatesurvey($sid)
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id the ID of the model to be updated
*/
public function updatesurveygroup($id = null, $gsid, $l = null)
public function updatesurveygroup($id, $gsid, $l = null)
{
if (Permission::model()->hasGlobalPermission('templates', 'update')) {
// @todo : review permission : template permission or group permission ?
Expand Down
2 changes: 1 addition & 1 deletion framework/YiiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class YiiBase
*/
public static function getVersion()
{
return '1.1.23';
return '1.1.24-dev';
}

/**
Expand Down
30 changes: 21 additions & 9 deletions framework/db/CDbConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,7 @@ public function quoteValue($str)
return $str;

$this->setActive(true);
if(($value=$this->_pdo->quote($str))!==false)
return $value;
else // the driver doesn't support quote (e.g. oci)
return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'";
return $this->quoteValueInternal($str, PDO::PARAM_STR);
}

/**
Expand All @@ -591,15 +588,30 @@ public function quoteValue($str)
* This parameter will be passed to the `PDO::quote()` function.
* @return string the properly quoted string.
* @see http://www.php.net/manual/en/function.PDO-quote.php
* @since 1.1.18
* @since 1.1.18
*/
public function quoteValueWithType($value, $type)
{
$this->setActive(true);
if(($quoted=$this->_pdo->quote($value, $type))!==false)
return $quoted;
else // the driver doesn't support quote (e.g. oci)
return "'" . addcslashes(str_replace("'", "''", $value), "\000\n\r\\\032") . "'";
return $this->quoteValueInternal($value, $type);
}

/**
* Quotes a value for use in a query using a given type. This method is internally used.
* @param mixed $value
* @param int $type
* @return string
*/
private function quoteValueInternal($value, $type)
{
if(mb_stripos($this->connectionString, 'odbc:')===false)
{
if(($quoted=$this->_pdo->quote($value, $type))!==false)
return $quoted;
}

// fallback for drivers that don't support quote (e.g. oci and odbc)
return "'" . addcslashes(str_replace("'", "''", $value), "\000\n\r\\\032") . "'";
}

/**
Expand Down
6 changes: 4 additions & 2 deletions framework/db/CDbTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function commit()
if($this->_active && $this->_connection->getActive())
{
Yii::trace('Committing transaction','system.db.CDbTransaction');
$this->_connection->getPdoInstance()->commit();
if($this->_connection->getPdoInstance()->inTransaction())
$this->_connection->getPdoInstance()->commit();
$this->_active=false;
}
else
Expand All @@ -77,7 +78,8 @@ public function rollback()
if($this->_active && $this->_connection->getActive())
{
Yii::trace('Rolling back transaction','system.db.CDbTransaction');
$this->_connection->getPdoInstance()->rollBack();
if($this->_connection->getPdoInstance()->inTransaction())
$this->_connection->getPdoInstance()->rollBack();
$this->_active=false;
}
else
Expand Down
6 changes: 3 additions & 3 deletions framework/vendors/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ <h1>Third-Party Library List</h1>
</tr>

<tr>
<td><a href="http://jquery.com">jQuery 1.11.1</a></td>
<td><a href="https://jquery.com/">jQuery 1.12.4</a></td>
<td><a href="jquery/LICENSE.txt">MIT</a></td>
<td>most JavaScript-related functionalities</td>
</tr>
<tr>
<td><a href="http://www.jqueryui.com">jQuery UI 1.11.2</a></td>
<td><a href="jqueryui/MIT-LICENSE.txt">MIT</a></td>
<td><a href="http://www.jqueryui.com">jQuery UI 1.12.1</a></td>
<td><a href="jqueryui/LICENSE.txt">MIT</a></td>
<td>the widgets under zii/widgets/jui</td>
</tr>
<tr>
Expand Down
21 changes: 18 additions & 3 deletions framework/vendors/jquery/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Copyright 2014 jQuery Foundation and other contributors
http://jquery.com/
Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -18,4 +26,11 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
43 changes: 43 additions & 0 deletions framework/vendors/jqueryui/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui

The following license applies to all parts of this software except as
documented below:

====

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

====

Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.

CC0: http://creativecommons.org/publicdomain/zero/1.0/

====

All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.
2 changes: 1 addition & 1 deletion framework/web/CUrlManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function parseUrl($request)
}
if($this->useStrictParsing)
throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
array('{route}'=>substr($pathInfo,0,20))));
array('{route}'=>$pathInfo)));
else
return $pathInfo;
}
Expand Down
5 changes: 2 additions & 3 deletions framework/web/CWebApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,9 @@ public function runController($route)
$controller->run($actionID);
$this->_controller=$oldController;
}
else {
else
throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
array('{route}'=>$route===''?substr($this->defaultController,0,20).'...':substr($route,0,20).'...')));
}
array('{route}'=>$route===''?$this->defaultController:$route)));
}

/**
Expand Down
32 changes: 23 additions & 9 deletions framework/web/helpers/CHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ class CHtml
* @since 1.1.13
*/
public static $closeSingleTags=true;
/**
* @var boolean whether to add <code>type="javascript"</code> to <code>&lt;script&gt;</code> tags. Defaults to true. Can be set to false for HTML5.
* @since 1.1.24
*/
public static $setScriptType=true;
/**
* @var boolean whether to add a CDATA wrapper around <code>&lt;script&gt;</code> and <code>&lt;style&gt;</code> contents. Defaults to true. Can be set to false for HTML5.
* @since 1.1.24
*/
public static $cdataScriptAndStyleContents=true;
/**
* @var boolean whether to render special attributes value. Defaults to true. Can be set to false for HTML5.
* @since 1.1.13
Expand Down Expand Up @@ -252,7 +262,9 @@ public static function css($text,$media='')
{
if($media!=='')
$media=' media="'.$media.'"';
return "<style type=\"text/css\"{$media}>\n/*<![CDATA[*/\n{$text}\n/*]]>*/\n</style>";
if(self::$cdataScriptAndStyleContents)
$text="/*<![CDATA[*/\n{$text}\n/*]]>*/";
return "<style type=\"text/css\"{$media}>\n{$text}\n</style>";
}

/**
Expand Down Expand Up @@ -291,11 +303,13 @@ public static function cssFile($url,$media='')
*/
public static function script($text,array $htmlOptions=array())
{
$defaultHtmlOptions=array(
'type'=>'text/javascript',
);
$defaultHtmlOptions=array();
if(self::$setScriptType)
$defaultHtmlOptions['type']='text/javascript';
$htmlOptions=array_merge($defaultHtmlOptions,$htmlOptions);
return self::tag('script',$htmlOptions,"\n/*<![CDATA[*/\n{$text}\n/*]]>*/\n");
if(self::$cdataScriptAndStyleContents)
$text="/*<![CDATA[*/\n{$text}\n/*]]>*/";
return self::tag('script',$htmlOptions,"\n{$text}\n");
}

/**
Expand All @@ -306,10 +320,10 @@ public static function script($text,array $htmlOptions=array())
*/
public static function scriptFile($url,array $htmlOptions=array())
{
$defaultHtmlOptions=array(
'type'=>'text/javascript',
'src'=>$url
);
$defaultHtmlOptions=array();
if(self::$setScriptType)
$defaultHtmlOptions['type']='text/javascript';
$defaultHtmlOptions['src']=$url;
$htmlOptions=array_merge($defaultHtmlOptions,$htmlOptions);
return self::tag('script',$htmlOptions,'');
}
Expand Down

0 comments on commit 5cdf20f

Please sign in to comment.